Skip to content

Commit

Permalink
fix: separate insert/replace ranges for cmdline
Browse files Browse the repository at this point in the history
Closes #994
  • Loading branch information
Saghen committed Jan 19, 2025
1 parent 712af9f commit a38c6d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/blink/cmp/sources/cmdline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ function cmdline:get_completions(context, callback)
sortText = label:lower():gsub('^([!-@\\[-`])', '~%1'),
textEdit = {
newText = new_text,
range = {
insert = {
start = { line = 0, character = #text_before_argument },
['end'] = { line = 0, character = math.min(#text_before_argument + #current_arg, vim.fn.getcmdpos() - 1) },
},
replace = {
start = { line = 0, character = #text_before_argument },
['end'] = { line = 0, character = #text_before_argument + #current_arg },
},
Expand Down

0 comments on commit a38c6d8

Please sign in to comment.