vim-evanesco icon indicating copy to clipboard operation
vim-evanesco copied to clipboard

Problem with highlighting after running custom substitution mapping

Open mroavi opened this issue 4 years ago • 0 comments

Hi @pgdouyon. I'm running into a strange problem. I have a mapping that I use very often to substitute instances of a given word on a selected range of lines, with another word:

vnoremap <Leader>su :s//<C-r>=substitute(@/,'\\<\\|\\>\\|\\V','','g')<CR>/g<left><left>

The problem is that after using this mapping, evanescu stops highlighting properly. Here is a demo:

evanesco-bug_Peek 2021-09-22 17-06

Here is a summary of the commands I'm running:

  1. Type * to save the word under the cursor in the search register
  2. Go to visual line mode to select which lines should be affected by the substitution command.
  3. Invoke the mapping above to substitute the string in the search register with a string that starts with the same characters (e.g evanescu with even).
  4. Type * on a different word. Note that not all instances are highlighted properly.

Do know what could be going wrong?

Edit: apparently, after running the substitution mapping above, evanescu only highlights words in the range of lines that were previously selected.

mroavi avatar Sep 22 '21 22:09 mroavi