File tree Expand file tree Collapse file tree 2 files changed +31
-10
lines changed Expand file tree Collapse file tree 2 files changed +31
-10
lines changed Original file line number Diff line number Diff line change @@ -88,11 +88,21 @@ endfunction
8888
8989" s:get_lines {{{1
9090function ! s: get_lines () abort
91- let signlist = sy#util#execute (' sign place buffer=' . b: sy .buffer )
92-
9391 let lines = []
94- for line in split (signlist, ' \n' )[2 :]
95- call insert (lines , matchlist (line , ' \v^\s+line\=(\d+)' )[1 ], 0 )
92+
93+ let has_sign_func = has (' patch-8.1.614' )
94+ if has_sign_func
95+ let signlist = sign_getplaced (b: sy .buffer )[0 ].signs
96+ else
97+ let signlist = split (sy#util#execute (' sign place buffer=' . b: sy .buffer ), ' \n' )[2 :]
98+ endif
99+
100+ for signline in signlist
101+ if has_sign_func
102+ call insert (lines , signline.lnum, 0 )
103+ else
104+ call insert (lines , matchlist (line , ' \v^\s+line\=(\d+)' )[1 ], 0 )
105+ endif
96106 endfor
97107
98108 return reverse (lines )
Original file line number Diff line number Diff line change @@ -28,13 +28,24 @@ function! sy#sign#get_current_signs(sy) abort
2828 let a: sy .internal = {}
2929 let a: sy .external = {}
3030
31- let signlist = sy#util#execute (' sign place buffer=' . a: sy .buffer )
31+ let has_sign_func = has (' patch-8.1.614' )
32+ if has_sign_func
33+ let signlist = sign_getplaced (a: sy .buffer )[0 ].signs
34+ else
35+ let signlist = split (sy#util#execute (' sign place buffer=' . a: sy .buffer ), ' \n' )[2 :]
36+ endif
3237
33- for signline in split (signlist, ' \n' )[2 :]
34- let tokens = matchlist (signline, ' \v^\s+\S+\=(\d+)\s+\S+\=(\d+)\s+\S+\=(.*)$' )
35- let line = str2nr (tokens[1 ])
36- let id = str2nr (tokens[2 ])
37- let type = tokens[3 ]
38+ for signline in signlist
39+ if has_sign_func
40+ let line = signline.lnum
41+ let id = signline.id
42+ let type = signline.name
43+ else
44+ let tokens = matchlist (signline, ' \v^\s+\S+\=(\d+)\s+\S+\=(\d+)\s+\S+\=(.*)$' )
45+ let line = str2nr (tokens[1 ])
46+ let id = str2nr (tokens[2 ])
47+ let type = tokens[3 ]
48+ endif
3849
3950 if type = ~# ' ^Signify'
4051 " Handle ambiguous signs. Assume you have signs on line 3 and 4.
You can’t perform that action at this time.
0 commit comments