-
Notifications
You must be signed in to change notification settings - Fork 16
Discussing PR for performance improvement, better support for many labels, vim-mode-plus integration and others #114
Description
Hi,
I've been hacking around your wonderful package recently, and I've got some pretty interesting results I'd like to contribute back, if possible.
I started by customizing the regex because I wanted to match start of word, end of word, camel bumps, start of line, end of line, symbols, empty lines... Basically everywhere. I ended up with the following monster:
matchPattern: "[\\w]\\b\\s*|\\S\\s+|\\b[\\S]|.$|&+|[=!]?={1,2}|[!|?_.@$#*\\^\"'`{}<>()\\[\\]/]|[A-Z](?![A-Z])|^s*$"
Don't try it in the current version, it will loop infinitely if ^s*$ matches an empty line. I had to hack something in here.
Anyway, the regex gives me satisfaction, but there are overlapping labels. So, I added some CSS classes to be able to hide the first character that was matched, in order to see the 2nd char for the overlapped labels.
Also, I prefer to always have labels in uppercase for better visibility. So I added another class to be able to style uppercase chars so I can differentiate them (I made them red).
Unfortunately, so many labels began to noticeably drag performance #110 ... I identified the bottleneck to be Atom's markers rendering. So I changed strategy to direct DOM manipulation, for a 3-4x gain from finger to eye :)
The reason I wanted such a fine control over the landing point in the first place was for smooth integration with vim-mode-plus. So I've added some interop by turning jumps into a vim-mode-plus motion, so I can yank to jump, or d to jump directly.
Having familiarized myself with the code base, I took the opportunity to enable Jumpy for the settings view because I was quite frustrated with keyboard navigation in settings since I switched to Atom. And I also enabled Jumpy for the tree view, because it was easy at this point.
Finally, I've added an alternating left/right hand label generation strategy (on a best effort basis, considering I usually have too much labels to spare using all possible combos), and smart case match -- case insensitive matching if there's no ambiguity, for when I forget caps lock.
The problem is all this required rewrite of significant portions of code, and all parts have became quite interdependent, so I won't be able to PR features individually. Also, I've not always been ultra respectful of the existing coding style or the TS semantics... And I broke your tests too, for now. Maybe my changes have a chance of being breaking to some user's customisations too (dunno about that).
That's why I'd like to discuss how best to proceed with you. So I'd be glad if you could have a look at my fork (branch rixo) and tell me if you'd be interested in collaborating in order to integrate my changes back into Jumpy.
Cheers.