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

Can't click through to the file #21

Closed
jamie-pate opened this issue Apr 23, 2013 · 6 comments
Closed

Can't click through to the file #21

jamie-pate opened this issue Apr 23, 2013 · 6 comments

Comments

@jamie-pate
Copy link

Being able to search scope is really nice, but when the results menu pops up I can't click through to the file it found.

@vanrijn
Copy link
Collaborator

vanrijn commented Apr 24, 2013

Hey Jamie,

Sublime Text has some... issues... regarding mouse handling for plugins. If you look in the closed issues list for this plugin, you'll see some of the background for my statement. Anyway, can you please try clicking on the line you want to go to (or arrowing to it) and then pressing "Enter" and see if it takes you to the file and line you're trying to navigate to?

Thanks!

@jamie-pate
Copy link
Author

Enter key works, it looks like double click is supposed to work but it doesn't (at least in linux, ubuntu 12.04 ST2.0.1 build 2217)

@vanrijn
Copy link
Collaborator

vanrijn commented Jul 10, 2013

Hopefully plugins will be able to support double clicks in ST3. I hope.

@ceeeKay
Copy link

ceeeKay commented Apr 3, 2014

It took me a while just to figure out I could click a filename and hit the enter key. Seems missing from the README. I thought I needed another plug-in to be able to go to the files.

@redhat008
Copy link

Hi, guys, I add some code at the end of cscope.py file. And modify the mousemap file in the User dir.
This work for me. Guys could try it.
Here is the code:

class CustomCscopeVisiter(sublime_plugin.TextCommand):
    def run(self, edit):
        if self.view.name().startswith("Cscope results"):
            self.view.run_command("cscope_visiter")
            return

        for sel in self.view.sel():
            if sel.empty():
                sel = self.view.word(sel)
            self.view.sel().clear()
            self.view.sel().add(sel)
            self.view.show(sel)

mousemap:

{"button": "button1", "count": 2, "modifiers": [], "command": "custom_cscope_visiter"},

Link:
cscope.py:
https://github.com/redhat008/sublimepacksync/blob/master/Packages/Cscope/cscope.py

mousemap :
https://github.com/redhat008/sublimepacksync/blob/master/Packages/User/Default%20(Windows).sublime-mousemap

@vanrijn
Copy link
Collaborator

vanrijn commented Sep 6, 2016

I just checked and ST3 still does not support this. The problem is that there's no context settings for mouse bindings. So one and only one plugin can override the double-click handler like @redhat008 did above, and if more than one plugin does, it's a crap-shoot as to which plugin actually gets the event. There's nothing we can do here. We're doing the best we can by navigating to cscope results via keyboard key.

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

4 participants