-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
implement :GoSameIds #936
implement :GoSameIds #936
Conversation
@bhcleek I've carried your changes over here with the fixes and improvements I made. Thanks for all this again, I'm still testing it and think to merge it after the GopherCon workshop as I believe this should be thoroughly tested for edge cases. |
> | ||
set updatetime=100 | ||
< | ||
By defult it's disabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defult -> default
I don't think you need to use CursorHold. The docs for CursorMoved say "don't do anything that is slow", which is different than "it's an expensive operation". FWIW, I talked to Alan Donovan, and he confirmed that |
@bhcleek try to create a variable called I'm still using and testing it. Usually it takes time until I merge stuff like this. It's good because you'll find edge cases and fix them. |
Yeah, I do see some lag there. Here's another alternative solution that you may want to consider: http://vim.wikia.com/wiki/Prevent_frequent_commands_from_slowing_things_down. I'm totally onboard with taking the time to make sure it's tested and the edge cases are properly worked out. Please let me know if you need me to do anything else; I'm happy to help polish this up. |
FWIW, the reason I'd like to find a solution that uses CursorMoved instead of CursorHold is because I really like the highlighting as I'm moving through the file instead of having to wait for a pause after movement. |
I've been playing with this some more, and I don't see any lag when using CursorMoved, even when editing a large file that has unsaved changes. Could the lag you're seeing be resolved by moving |
Add :GoSameIds to highlight all identifiers in the current buffer that are equivalent to the identifier under the cursor.
* Use `CursorHold` for performance * Fix guru running for new buffers that are not saved yet * Fix runtime except by returning dict error * Fix showing not errors for auto_sameid * Improve docs * Add GoSameIdsClear and enable mapping * Add explicit highlighting
@bhcleek I've moved back to |
Thanks @fatih, and thank you for helping to polish this up. I enjoyed meeting you at GopherCon. Sorry I couldn't make your session on the hack day. |
You're welcome @bhcleek, me as well! I've mentioned you in the session as well and gave you a shoot out to your name :) I hope people remember you. And thanks again for your work, much appreciated. |
+1 |
Carried #933 over to here with additional improvements and fixes.