unblevable / quick-scope

Lightning fast left-right movement in Vim
MIT License
1.42k stars 54 forks source link

Non alphanumeric characters in `g:qs_accepted_chars` #61

Open puneetpahuja opened 4 years ago

puneetpahuja commented 4 years ago

I want to add non alphanumeric characters in g:qs_accepted_chars but it does not work. image

# and _ seem to work but others don't. Am, I doing something wrong here?

bradford-smith94 commented 4 years ago

This would be the correct way to do what you want, so there must be a bug in how target characters are interpreted.

bradford-smith94 commented 2 months ago

This is likely to due to a check against keyword characters (:help iskeyword). Quick-scope is currently ignoring non-keyword characters assuming they are a break between words that we are interested in highlighting (which following how word movement commands like w work, they would be).

An initial assumption may have been that these characters are generally easier to identify and shouldn't need quick-scope highlighting to quickly be identified if you want to jump to them.

In order to fully support this the block in the highlight pattern search function that checks keyword characters will need to be updated to also check if the character is in g:qs_accepted_chars and consider it for highlighting as well. This update will likely need to be done carefully as it could also break quick-scope's idea of word boundaries.