inkarkat / vim-mark

Highlight several words in different colors simultaneously.
http://www.vim.org/scripts/script.php?script_id=2666
266 stars 32 forks source link

for a multi-line mark, * on cursor degrades to vim search #30

Closed ericsunplus closed 4 years ago

ericsunplus commented 4 years ago

Describe the bug

When I specify a multi line regular expression for match, use <Leader>/ is fine for next occurence, but after the cursor is on highlight, * don't jump to next mark, instead it becomes vim normal * which simply search for the word under cursor

How to Reproduce For example, using the following text

This is a test
for inkarkat vim-mark
I want to mark a pattern
in multiple lines
the cursor is on the search
but * becomes vim superstar for normal search
  1. :Mark /.*vim.*\n.*pattern/, this will mark line 2 and line 3
  2. Using <Leader>/ to jump to the first(only) Mark match
  3. With the cursor on line 2, use *, this time it searches for for under cursor instead for the next mark occurrence

Environment

inkarkat commented 4 years ago

Navigating to marks was only supported from the first line, as this comment shows:

The mark can include the trailing newline character that concludes the line, but marks that span multiple lines are not supported.

However, by reusing a function from the ingo-library plugin (or via GitHub (the latest development snapshot is needed), this can be made to work.

Thanks for the report; the how to reproduce steps helped a lot to quickly see the problem!

ericsunplus commented 4 years ago

Just sync vim-ingo-library and vim-mark to latest on their master branch and the problem get solved. Thank you for the great plugin and the quick problem solving, really help me a lot in my coding.