fix: make sure completion replacment always reaches at least to the cursor
Seems like sometimes LSPs may lag and not include the last entered char in the selection.
This commit is contained in:
parent
7a3b8e3fce
commit
f65082bea9
1 changed files with 1 additions and 1 deletions
|
|
@ -302,7 +302,7 @@ fn get_replacement_selection(editor: *ed.Editor, insert_: ?Buffer.Selection, rep
|
|||
const cursor = editor.get_primary().cursor;
|
||||
return switch (tui.config().completion_insert_mode) {
|
||||
.insert => .{ .begin = sel.begin, .end = cursor },
|
||||
.replace => sel,
|
||||
.replace => if (!cursor.within(sel)) .{ .begin = sel.begin, .end = cursor } else sel,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue