aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2021-10-19 09:59:00 +0200
committerMax Christian Pohle2021-10-19 09:59:00 +0200
commitdf83bdccd7ce16c97e76011da9d70c17a1d243af (patch)
tree10fc12c7f30c9049f10d08f3789e3fb8cebf6e0b
parentb6f9c6c0318caee7242f9426c39a1ae206275997 (diff)
downloadvim-under-the-cursor-df83bdccd7ce16c97e76011da9d70c17a1d243af.tar.bz2
vim-under-the-cursor-df83bdccd7ce16c97e76011da9d70c17a1d243af.zip
Fix: Color preview now also works within comments
-rw-r--r--plugin/vim-under-the-cursor.vim3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugin/vim-under-the-cursor.vim b/plugin/vim-under-the-cursor.vim
index cc31e36..b91c2bd 100644
--- a/plugin/vim-under-the-cursor.vim
+++ b/plugin/vim-under-the-cursor.vim
@@ -43,7 +43,8 @@ function! HighlightWordUnderCursor()
43 endif 43 endif
44 44
45 exec 'syntax clear ' . l:color 45 exec 'syntax clear ' . l:color
46 exec 'syntax match ' . l:color . ' /\#' . l:q . '\>/' 46 exec 'syntax match ' . l:color . ' /\#' . l:q . '\>/' .
47 \ ' containedin=' . synIDattr(synstack(line('.'), col('.'))[0], "name") . ' contained'
47 else 48 else
48 silent! call matchadd('Underlined', '\<'.l:currentword.'\>', -1, w:m1) 49 silent! call matchadd('Underlined', '\<'.l:currentword.'\>', -1, w:m1)
49 endif 50 endif
..