From df83bdccd7ce16c97e76011da9d70c17a1d243af Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 19 Oct 2021 09:59:00 +0200 Subject: Fix: Color preview now also works within comments --- plugin/vim-under-the-cursor.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugin') 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() endif exec 'syntax clear ' . l:color - exec 'syntax match ' . l:color . ' /\#' . l:q . '\>/' + exec 'syntax match ' . l:color . ' /\#' . l:q . '\>/' . + \ ' containedin=' . synIDattr(synstack(line('.'), col('.'))[0], "name") . ' contained' else silent! call matchadd('Underlined', '\<'.l:currentword.'\>', -1, w:m1) endif -- cgit v1.2.3