Skip to content

Commit 3cec4a2

Browse files
committed
Fix wrong label placement after completion
1 parent 2fb9869 commit 3cec4a2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lua/neocodeium/completer.lua

+2
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ function Completer:accept()
363363
utils.set_lines(lnum, lnum, block)
364364
utils.set_cursor(pos)
365365
end
366+
-- required to update label position
367+
renderer.pos = pos
366368
end, 0)
367369
end
368370

lua/neocodeium/renderer.lua

+6
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ function Renderer:update_forward_line()
319319
else
320320
self.inline[1].text = self.block.text:sub(col + 1)
321321
self:clear_block()
322+
-- required to update label position
323+
nvim_buf_set_extmark(0, ns, self.pos[1], 0, {
324+
id = self.label.id,
325+
virt_text = { { " 0 ", "NeoCodeiumLabel" } },
326+
virt_text_win_col = -4,
327+
})
322328
end
323329
self.inline[1].id = show_inline(nil, self.inline[1].text, lnum, col)
324330
end

0 commit comments

Comments
 (0)