Skip to content

Commit 60a571e

Browse files
committed
fix: off by one error in within_query_bounds
1 parent be15af8 commit 60a571e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/blink/cmp/completion/trigger/context.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ end
7878
--- @return boolean
7979
function context:within_query_bounds(cursor)
8080
local row, col = cursor[1], cursor[2]
81+
col = col + 1 -- Convert from 0-indexed to 1-indexed
82+
8183
local bounds = self.bounds
82-
return row == bounds.line_number and col >= bounds.start_col and col < (bounds.start_col + bounds.length)
84+
return row == bounds.line_number and col >= bounds.start_col and col <= (bounds.start_col + bounds.length)
8385
end
8486

8587
function context.get_mode()

0 commit comments

Comments
 (0)