vim-evanesco
vim-evanesco copied to clipboard
Problem with highlighting after running custom substitution mapping
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:

Here is a summary of the commands I'm running:
- Type * to save the word under the cursor in the search register
- Go to visual line mode to select which lines should be affected by the substitution command.
- 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).
- 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.