Skip to content

Commit 25f7397

Browse files
committed
Copilot.vim 1.38.0
1 parent 0668308 commit 25f7397

File tree

4 files changed

+398
-428
lines changed

4 files changed

+398
-428
lines changed

autoload/copilot.vim

+20-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,26 @@ function! s:UpdatePreview() abort
353353
let data.hl_mode = 'combine'
354354
call nvim_buf_set_extmark(0, copilot#NvimNs(), line('.')-1, col('.')-1, data)
355355
elseif s:has_vim_ghost_text
356-
call prop_add(line('.'), col('.'), {'type': s:hlgroup, 'text': text[0]})
356+
let new_suffix = text[0]
357+
let current_suffix = getline('.')[col('.') - 1 :]
358+
let inset = ''
359+
while delete > 0 && !empty(new_suffix)
360+
let last_char = matchstr(new_suffix, '.$')
361+
let new_suffix = matchstr(new_suffix, '^.\{-\}\ze.$')
362+
if last_char ==# matchstr(current_suffix, '.$')
363+
if !empty(inset)
364+
call prop_add(line('.'), col('.') + len(current_suffix), {'type': s:hlgroup, 'text': inset})
365+
let inset = ''
366+
endif
367+
let current_suffix = matchstr(current_suffix, '^.\{-\}\ze.$')
368+
let delete -= 1
369+
else
370+
let inset = last_char . inset
371+
endif
372+
endwhile
373+
if !empty(new_suffix . inset)
374+
call prop_add(line('.'), col('.'), {'type': s:hlgroup, 'text': new_suffix . inset})
375+
endif
357376
for line in text[1:]
358377
call prop_add(line('.'), 0, {'type': s:hlgroup, 'text_align': 'below', 'text': line})
359378
endfor

autoload/copilot/version.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function! copilot#version#String() abort
2-
return '1.37.0'
2+
return '1.38.0'
33
endfunction

dist/language-server.js

+374-423
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/language-server.js.map

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)