#1 Fixing Open File Defect

open
eddt (1)
5
2007-02-24
2007-02-24
Anonymous
No

When opening a file in the current latest release of Eddt (0.1.8) if the user selects a file in the project explorer file tree that already has an open tab and the user double clicks on that file again, a duplicate read-only tab is opened for that file, instead of setting the existing tab to active. This patch fixes that problem.

The diff for eddt/projectexplorer.py is as follows (between my fixed version and 0.1.8):
< # Open the document in a new tab
< self.__window.create_tab_from_uri(str(uri),
< self.__encoding,
< 0, False, True)
---
> # NEW CODE...SPP!
> docs = self.__window.get_documents()
> for doc in docs:
> if str(doc.get_uri()) == str(uri):
> tab = gedit.gedit_tab_get_from_document(doc)
> return self.__window.set_active_tab(tab)
>
> # Open the document in a new tab
> return self.__window.create_tab_from_uri(str(uri),
> self.__encoding,
> 0, False, True)

Hope this helps,
Susan
http://susanpotter.net

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks