Skip to content

Commit db9b57b

Browse files
authored
update quickpick to 37e29b2 - fixes multi-byte strings (#1039)
1 parent 7442e27 commit db9b57b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

autoload/lsp/internal/ui/quickpick.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
" https://github.com/prabirshrestha/quickpick.vim#3c3d5850867a7308391a1143575f62677dc2ce3f
1+
" https://github.com/prabirshrestha/quickpick.vim#37e29b28f65d3ae344ec8eaf7ce2d5f87e2f4b90
22
" :QuickpickEmbed path=autoload/lsp/internal/ui/quickpick.vim namespace=lsp#internal#ui#quickpick prefix=lsp-quickpick
33

44
let s:has_timer = exists('*timer_start') && exists('*timer_stop')
@@ -252,7 +252,10 @@ function! s:update_items() abort
252252
let l:i = 0
253253
for l:line in s:state['highlights']
254254
for l:pos in l:line
255-
call prop_add(l:i + 1, l:pos + 1, { 'length': 1, 'type': 'highlight', 'bufnr': s:state['resultsbufnr'] })
255+
let l:cs = split(getbufline(s:state['resultsbufnr'], l:i + 1)[0], '\zs')
256+
let l:mpos = strlen(join(l:cs[: l:pos - 1], ''))
257+
let l:len = strlen(l:cs[l:pos])
258+
call prop_add(l:i + 1, l:mpos + 1, { 'length': l:len, 'type': 'highlight', 'bufnr': s:state['resultsbufnr'] })
256259
endfor
257260
let l:i += 1
258261
endfor

0 commit comments

Comments
 (0)