From cd3665840df5994d5c697a2112135b5e975f6467 Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Sat, 20 Nov 2021 10:20:28 -0500 Subject: [PATCH] Add hlgroup MatchupVirtualText --- autoload/matchup.vim | 3 ++- autoload/matchup/matchparen.vim | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/autoload/matchup.vim b/autoload/matchup.vim index 36f36a5..504405b 100644 --- a/autoload/matchup.vim +++ b/autoload/matchup.vim @@ -4,6 +4,8 @@ " Email: a@normed.space " +scriptencoding utf-8 + let s:save_cpo = &cpo set cpo&vim @@ -381,4 +383,3 @@ endfunction let &cpo = s:save_cpo " vim: fdm=marker sw=2 - diff --git a/autoload/matchup/matchparen.vim b/autoload/matchup/matchparen.vim index 05d152e..63ee8bf 100644 --- a/autoload/matchup/matchparen.vim +++ b/autoload/matchup/matchparen.vim @@ -9,7 +9,7 @@ scriptencoding utf-8 let s:save_cpo = &cpo set cpo&vim -function! matchup#matchparen#init_module() " {{{1 +function! matchup#matchparen#init_module() abort " {{{1 if !g:matchup_matchparen_enabled | return | endif call matchup#matchparen#enable() @@ -1088,10 +1088,13 @@ function! s:add_matches(corrlist, ...) " {{{1 if exists('s:ns_id') if strlen(l:corr.match) == 0 && !matchup#ts_engine#get_option( \ bufnr('%'), 'disable_virtual_text') + if hlexists('MatchupVirtualText') + let l:group = 'MatchupVirtualText' + endif call nvim_buf_set_extmark(0, s:ns_id, \ l:corr.lnum - 1, l:corr.cnum - 1, { - \ 'virt_text': [[g:matchup_matchparen_end_sign . ' ' . - \ a:corrlist[0].match, l:group]], + \ 'virt_text': [[g:matchup_matchparen_end_sign . ' ' + \ . a:corrlist[0].match, l:group]], \}) else call nvim_buf_add_highlight(0, s:ns_id, l:group,