Skip to content

Commit 07a09ac

Browse files
authored
fix: unhandled terminal mode in set_cursor implementation (#1672)
1 parent 5d90bfc commit 07a09ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lua/blink/cmp/completion/accept/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ local function apply_item(ctx, item)
6868

6969
text_edits_lib.apply(item.textEdit, all_text_edits)
7070

71-
if ctx.get_mode() ~= 'term' then ctx.set_cursor(new_cursor) end
71+
ctx.set_cursor(new_cursor)
7272
text_edits_lib.move_cursor_in_dot_repeat(offset)
7373
end
7474

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ end
101101

102102
function context.set_cursor(cursor)
103103
local mode = context.get_mode()
104-
if mode == 'default' then return vim.api.nvim_win_set_cursor(0, cursor) end
104+
if mode == 'default' or mode == 'term' then return vim.api.nvim_win_set_cursor(0, cursor) end
105105

106106
assert(mode == 'cmdline', 'Unsupported mode for setting cursor: ' .. mode)
107107
assert(cursor[1] == 1, 'Cursor must be on the first line in cmdline mode')

0 commit comments

Comments
 (0)