Closed kiryph closed 6 years ago
Believe it or not, this is not a bug but is due to the definition of b:match_words
in ftplugin/vim.vim
.
Try the following (please do an update of the plugin first),
" file: test/issues/7/hotfix.vim
function! AugroupHotfix()
call matchup#util#patch_match_words(
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:',
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S\+:')
endfunction
let g:matchup_hotfix_vim = 'AugroupHotfix'
Equivalently, it could be patched to not show the augroup name.
Note: if you execute this after loading you must reload the test example using :edit
.
Thanks for clarifying this and considering it despite that is related to the definition in $VIMRUNTIME/ftplugin/vim.vim.
With your hotfix it looks now as following:
I guess I would prefer that only the matched words are highlighted. This seems to be more consistent compared to if elseif
etc.
Since this is actually not related to your plugin, I close this issue.
Thanks for testing. Here is an example which does not highlight the name.
" file: test/issues/7/hotfix2.vim
function! AugroupHotfix()
call matchup#util#patch_match_words(
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:',
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S\@=:')
endfunction
let g:matchup_hotfix_vim = 'AugroupHotfix'
Note that the hotfix function is general and can be used for any filetype with g:matchup_hotfix_{&filetype}
.
See following screenshot: