Skip to content

Commit

Permalink
Improve virtual text
Browse files Browse the repository at this point in the history
  • Loading branch information
luozhiya committed Jun 2, 2024
1 parent 98168fb commit 25ff447
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/fittencode/engines/inline/model.lua
Original file line number Diff line number Diff line change
Expand Up @@ -488,15 +488,15 @@ end

---@return boolean
function InlineModel:is_advance(window, buffer)
local triggered_cursor = self.cache.triggered_cursor
if not triggered_cursor or not triggered_cursor[1] or not triggered_cursor[2] then
return false
end
local row, col = Base.get_cursor(window)
local char = api.nvim_buf_get_lines(buffer, row, row + 1, false)[1]:sub(col, col)
if not char or char == '' then
return false
end
local triggered_cursor = self.cache.triggered_cursor
if not triggered_cursor or not triggered_cursor[1] or not triggered_cursor[2] then
return false
end
local cache_char = self:get_next_char()
return triggered_cursor[1] == row and triggered_cursor[2] + 1 == col and char == cache_char
end
Expand Down

0 comments on commit 25ff447

Please sign in to comment.