Closed Siguza closed 4 years ago
Thanks for this.
I added a lookahead to the second part see this pull request: https://github.com/richrace/highlight-selected/pull/202/files
Can play with it here: Regex with a lookahead(00000000)(%3F%3D%5B%20%5Ct%5C%2F%5C%5C%5C(%5C)%22'%3A%2C%5C.%3B%3C%3E~!%40%23%5C%24%25%5C%5E%26%5C*%5C%7C%5C%2B%3D%5C%5B%5C%5D%5C%7B%5C%7D%60%5C%3F%5C-…%5D%7C%24)%7C%7C%7C%7Cg%7C%7C%7C%7C%5B%22%22%2C%2200000000%2000000000%2000000000%22%2C%2200000000.00000000.00000000%22%2C%2200000000-00000000-00000000%22%2C%22%22%2C%2200000000%20%2000000000%20%2000000000%22%2C%2200000000..00000000..00000000%22%2C%2200000000--00000000--00000000%22%5D)
I can't remember why I had the apm list | grep lint
command in the contributing guide. So I've opened #203 as it is a bit out of date. Thanks for following it though.
I can confirm this bug. Is there any fix planned?
This comment https://github.com/richrace/highlight-selected/issues/201#issuecomment-510648062
Links to a PR and an interactive JS regex console. Was looking to see if those changes fix it as I haven’t come across it.
This comment #201 (comment)
Links to a PR and an interactive JS regex console. Was looking to see if those changes fix it as I haven’t come across it.
Okay, I've applied proposed PR and tested it on my local machine. Seems to work just fine now:
I guess it can be merged into master for new version to have this bug fixed ;) P.S. Thanks for such a lightweight and useful plugin.
Thanks for confirming!
Version info
(Yeah, I have no package containing
lint
in its name installed - should I?)Issue
When the word that is supposed to be highlighted appears twice with only a single character in between, only one of them is highlighted:
Test file:
I often sift through hexdumps, so I definitely have a use case for this.
From glancing through the code, it would seem to me that changing
nonWordCharacters
in search-model.js to be embedded in lookbehind and lookahead groups rather than non-capturing groups might fix the issue, but I neither have a build setup to test this, nor did I want to create a pull request without actually understanding the codebase.