Skip to content

Commit

Permalink
Fix wrong label placement after completion
Browse files Browse the repository at this point in the history
  • Loading branch information
monkoose committed Sep 11, 2024
1 parent 2fb9869 commit 3cec4a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/neocodeium/completer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ function Completer:accept()
utils.set_lines(lnum, lnum, block)
utils.set_cursor(pos)
end
-- required to update label position
renderer.pos = pos
end, 0)
end

Expand Down
6 changes: 6 additions & 0 deletions lua/neocodeium/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ function Renderer:update_forward_line()
else
self.inline[1].text = self.block.text:sub(col + 1)
self:clear_block()
-- required to update label position
nvim_buf_set_extmark(0, ns, self.pos[1], 0, {
id = self.label.id,
virt_text = { { " 0 ", "NeoCodeiumLabel" } },
virt_text_win_col = -4,
})
end
self.inline[1].id = show_inline(nil, self.inline[1].text, lnum, col)
end
Expand Down

0 comments on commit 3cec4a2

Please sign in to comment.