unblevable / quick-scope

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

Fix g:qs_accepted_chars always being case-insensitive #63

Closed eilvelia closed 3 years ago

eilvelia commented 4 years ago

Currently

let g:qs_accepted_chars = [a-z, 0-9]

and

let g:qs_accepted_chars = [a-z, A-Z, 0-9]

behave the same.

The problem was in this line:

elseif (index(a:targets, char) != -1 && !g:qs_ignorecase) || index(a:targets, tolower(char)) != -1

If the character isn't found and g:qs_ignorecase set to false, it still fallbacks to tolower(char). So (index(a:targets, char) != -1 && !g:qs_ignorecase) doesn't make a difference here.

I replaced it with:

elseif index(a:targets, g:qs_ignorecase ? tolower(char) : char) != -1