rhysd / clever-f.vim

Extended f, F, t and T key mappings for Vim.
https://rhysd.github.io/clever-f.vim
1.01k stars 44 forks source link

Fix 't' and 'T' searching '\' #35

Closed ichizok closed 6 years ago

ichizok commented 6 years ago

Problem

t\ and T\ (searching backslash) cause a search error.

Repro steps

vimrc:

set rtp+=/path/to/clever-f.vim

vim -Nu vimrc

:normal! ia\a
:normal! gg0
:normal t\
Error detected while processing function clever_f#find_with[58]..<SNR>23_mark_char_in_current_line:
line    2:
E53: Unmatched \%(
E53: Unmatched \%(
E475: Invalid argument: \%1l\C\V\_.\ze\%(\\)

Invalid regex pattern is generated.

rhysd commented 6 years ago

You're correct. We should escape \ not to break regex. Thank you.