From 2623b460304dde0e8d648c53d91d4eb35f2d8af9 Mon Sep 17 00:00:00 2001 From: Arno Renevier Date: Wed, 22 Mar 2023 23:12:18 -0700 Subject: [PATCH] Handle non global groups --- autoload/signjump.vim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/autoload/signjump.vim b/autoload/signjump.vim index 1ee2948..f7fcb67 100644 --- a/autoload/signjump.vim +++ b/autoload/signjump.vim @@ -34,7 +34,7 @@ function! signjump#get_buffer_signs(buffer, names) abort let l:out = \ filter( - \ split(execute('sign place buffer='.a:buffer, 'silent'), '\n'), + \ split(execute('sign place group=* buffer='.a:buffer, 'silent'), '\n'), \ {idx, val -> \ val =~# '=' && (!empty(a:names) ? s:match_name(a:names, val) : 1)}) call map(l:out, 'v:val[4:]') " Trim indent @@ -53,7 +53,7 @@ function! signjump#get_buffer_signs(buffer, names) abort endfunction function! signjump#get_sign_data(sign, item) abort - return matchlist(a:sign, a:item.'\v\=(\d+)')[1] + return get(matchlist(a:sign, a:item.'\v\=(\w+)'), 1, "") endfunction function! s:nearest_sign_idx(signs, line, direction) abort @@ -101,8 +101,13 @@ function! signjump#jump_to_sign(sign) abort if g:signjump.use_jumplist execute 'normal!' signjump#get_sign_data(a:sign, 'line') . 'G' else - execute 'sign jump' signjump#get_sign_data(a:sign, 'id') - \ 'buffer=' . bufnr('%') + let l:group = signjump#get_sign_data(a:sign, 'group') + let l:id = signjump#get_sign_data(a:sign, 'id') + if l:group == "" + execute 'sign jump ' l:id 'buffer=' . bufnr('%') + else + execute 'sign jump ' . l:id . ' group=' . l:group . ' buffer=' . bufnr('%') + endif endif if g:signjump.debug