fix: completion with no replacements causes OOM
This commit is contained in:
parent
7b7c84628c
commit
288e23e8b0
1 changed files with 3 additions and 3 deletions
|
|
@ -192,10 +192,10 @@ const Range = struct { start: Position, end: Position };
|
|||
const Position = struct { line: usize, character: usize };
|
||||
|
||||
fn get_replace_selection(replace: Buffer.Selection) ?Buffer.Selection {
|
||||
return if (tui.get_active_editor()) |edt|
|
||||
replace.from_pos(edt.buf_root() catch return null, edt.metrics)
|
||||
else if (replace.empty())
|
||||
return if (replace.empty())
|
||||
null
|
||||
else if (tui.get_active_editor()) |edt|
|
||||
replace.from_pos(edt.buf_root() catch return null, edt.metrics)
|
||||
else
|
||||
replace;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue