From f9d13d8450ce640cc1efe725ef0b45f626fa38b8 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 10 Oct 2021 12:44:18 +0200 Subject: Added end-of-word to syntax group --- doc/vim-under-the-cursor.txt | 11 +++++++++++ plugin/vim-under-the-cursor.vim | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/vim-under-the-cursor.txt b/doc/vim-under-the-cursor.txt index a799d82..2b41372 100644 --- a/doc/vim-under-the-cursor.txt +++ b/doc/vim-under-the-cursor.txt @@ -9,4 +9,15 @@ can be activated with :set termguicolors + +============================================================================== +EXAMPLE *vim-under-the-cursor-example* + + #ff0000 + #ff000088 + #00ff00 + #00ff0088 + #0000ff + #0000ff88 + vim:tw=78:ts=8:ft=help:norl: diff --git a/plugin/vim-under-the-cursor.vim b/plugin/vim-under-the-cursor.vim index 403164a..66e661d 100644 --- a/plugin/vim-under-the-cursor.vim +++ b/plugin/vim-under-the-cursor.vim @@ -43,7 +43,7 @@ function! HighlightWordUnderCursor() endif exec 'syntax clear ' . l:color - exec 'syntax match ' . l:color . ' /\#' . l:q . '/' + exec 'syntax match ' . l:color . ' /\#' . l:q . '\>/' else silent! call matchadd('Underline', '\<'.l:currentword.'\>', -1, w:m1) endif -- cgit v1.2.3