Skip to content

Commit

Permalink
Handle non global groups
Browse files Browse the repository at this point in the history
  • Loading branch information
arenevier committed Mar 23, 2023
1 parent fd4103e commit 9d317d8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions autoload/signjump.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9d317d8

Please sign in to comment.