Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

searches files from the last opened gedit root dir #13

Open
gautamkpai opened this issue May 31, 2012 · 4 comments
Open

searches files from the last opened gedit root dir #13

gautamkpai opened this issue May 31, 2012 · 4 comments

Comments

@gautamkpai
Copy link

When i open a file in directory abc using gedit and i use snapopen to search it searches files properly from within directory abc.

Now suppose I open one more gedit window to open a file from directory xyz. When i now got to project abc and search using snapopen it searches file only from within directory xyz.

Is there anyway to start searching from the root directory of current window's file browser panel?

I am using gedit 3.2.3. And installed snapopen through latest gedit-gmate package.

@MadsBuus
Copy link
Owner

take a look at the get_filebrowser_root:
https://github.com/MadsBuus/gedit-snapopen-plugin/blob/master/snapopen/__init__.py#L205
the 'root' comes from the gnome settings registry: org.gnome.gedit.plugins.filebrowser, the setting 'virtual-root'. My guess is that this setting is actually overwritten by the second window (or rather: kept in memory for each window, but only stored once)
I haven't looked into it yet, you would be most welcome.

@gautamkpai
Copy link
Author

yup, thats the problem. The setting 'virtual-root' is being overwritten by the gedit window opened last. That effectively means that snap-open would work when you have only one window open.

Any ideas on an alternative approach to fix that? And thanks for a quick response.

@MadsBuus
Copy link
Owner

No, I'm sorry. This was my very first venture into both gtk and python, and I haven't really had time to go into the gconf documentation. What I did was a googled attempt at reading the current 'root' from the application. You could perhaps hook into the 'set as root folder' event in the gedit file browser pane, and do your own track-keeping of 'roots' per window, but I think I will hope for a Pull Request on that one :-)

/Mads

@rubencaro
Copy link

You could take a look at how shipped 'quickopen' plugin does this. They seem to have solved this issue.

http://git.gnome.org/browse/gedit/tree/plugins/quickopen/quickopen/__init__.py#n79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants