On Sun, 11 Apr 2021 at 22:53, Bram Moolenaar <[email protected]> wrote:
> It is possible to only match "endif" at the start of the line or after a
> bar:
>
> '\<if\>:\%(^\||\)\s*el\%[seif]\>:\%(^\||\)\s*en\%[dif]\>,'
>
> But then the cursor will move to the start of the line or the bar.
> Putting in \zs to position the cursor doesn't work, because the plugin
> uses \zs itself.
Using a lookbehind works here.
E.g.,
\ '\<if\>:\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' .
You might be able to come up with a more general solution by extending
the match_skip test.
Regards,
Doug
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAJ1uvoDcK3UvA4%3DYOsFe6uundWTPbUsZh7UTJn9gPKiQRLiACA%40mail.gmail.com.