diff --git a/autoload/SpaceVim/plugins/highlight.vim b/autoload/SpaceVim/plugins/highlight.vim index 2e09b95f4..bac144a27 100644 --- a/autoload/SpaceVim/plugins/highlight.vim +++ b/autoload/SpaceVim/plugins/highlight.vim @@ -309,7 +309,9 @@ function! s:highlight() abort for item in s:stack call add(s:highlight_id, s:CMP.matchaddpos('HiBlueBold', [ item ])) endfor - let s:highlight_id_c = s:CMP.matchaddpos('HiPurpleBold', [s:stack[s:index]]) + if !empty(get(s:stack, s:index, [])) + let s:highlight_id_c = s:CMP.matchaddpos('HiPurpleBold', [s:stack[s:index]]) + endif endfunction " }}} diff --git a/test/plugin/highlight.vader b/test/plugin/highlight.vader index 0b3b1f541..95bf5f0ed 100644 --- a/test/plugin/highlight.vader +++ b/test/plugin/highlight.vader @@ -7,7 +7,7 @@ Given (fixture): Hello Hello -Execute ( SpaceVim plugin: iedit ): +Execute ( SpaceVim plugin: highlight.vim `SPC s h/H` ): let g:_spacevim_input_list = ['e', 'D', 'a', 'W', 'o', 'r', 'l', 'd', "\", "\"] call SpaceVim#plugins#highlight#start()