ameyp / CscopeSublime

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

Jumping To Search Results Is Too Sensitive #7

Closed blockbomb closed 11 years ago

blockbomb commented 11 years ago

I would like the search result buffers that are opened to act like the built in "find" search results, where you can click around the file and not jump to that selection until you double click.

I see it working like this let me know what you think. 1) Cscope for your symbol/definition/callers/callees 2) results window comes up 3) you can navigate the results window and not jump anywhere until you either a) hit enter on the line or b) double click the line with your mouse.

right now if you move the cursor it will jump as soon as it hits a line it can decipher as a file name. This is due to the fact that the event it waits on is the selection changed I'm not well versed in the Sublime API but we should change that for a different event or at least add some thing there to not always evaluate until the users wants it to.

I will look into it more but if anyone has any ideas they will be much appreciated.

ameyp commented 11 years ago

I know what you're talking about, and I wanted to make it like the find results too. Unfortunately, the Sublime plugin API doesn't have mouse events, so I don't know of any way by which I can make it jump to results on double-click. I'll keep the issue open, if you can find a way of making it work on double-click I'd be happy to change it.

vanrijn commented 11 years ago

I would appreciate this change in behavior too. IIRC, the Sublime Git plugin has a similar situation. A patch was submitted (https://github.com/kemayo/sublime-text-2-git/pull/224) that used the enter key to navigate. I think this would be an improvement.

vanrijn commented 11 years ago

Hm. Maybe https://github.com/SublimeText/MouseEventListener might be helpful?

vanrijn commented 11 years ago

Actually, I think I got this one. I have this working here on both enter key press and double-click. Will send a pull request in a sec.

ameyp commented 11 years ago

@vanrijn Dude, you rock. Seriously.

Confirmed working in Windows and OSX, will check on Linux in a bit.

vanrijn commented 11 years ago

LOL! Thanks Amey! You just made my night! =:)

ameyp commented 11 years ago

Haha, cheers :) Is Vanrijn your name?

vanrijn commented 11 years ago

Heh. No, I've just been using it forever online. http://movingparts.net/2002/02/02/allow-me-to-introduce-myself/ =:)

ameyp commented 11 years ago

That was an excellent read. Nice to meet you, Jason :)

ameyp commented 11 years ago

Coming back on-topic, confirmed working in Linux, so closing the issue.

Fixed with commit https://github.com/ameyp/CscopeSublime/commit/918d3a73cdfe42d9c826851b01ba4ac75579708f thanks to pull request https://github.com/ameyp/CscopeSublime/pull/11 by @vanrijn .