ameyp / CscopeSublime

A Cscope plugin for Sublime Text 2 and 3
89 stars 37 forks source link

Can't click through to the file #21

Closed jamie-pate closed 8 years ago

jamie-pate commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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

ceeeKay commented 10 years ago

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 commented 10 years ago

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 commented 8 years ago

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.