diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-04 23:45:03 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-01-04 23:48:42 +0100 |
| commit | f2f382e2baf94fb5491883bfe9fc4e7a160781ff (patch) | |
| tree | b763e9210b4b94e5861013b4982d335aeb3807dc /init.lua | |
| parent | 53cebbabeb224a0370848ee71eff80b9e6b67671 (diff) | |
| download | vis-lspc-f2f382e2baf94fb5491883bfe9fc4e7a160781ff.tar.gz vis-lspc-f2f382e2baf94fb5491883bfe9fc4e7a160781ff.zip | |
fix completions using textEdit
Fix the off-by-one manual range conversion by using the already available
helper function.
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -333,16 +333,7 @@ end local function vis_apply_textEdit(win, file, textEdit) assert(win.file == file) - local start_pos = lsp_pos_to_vis_sel(textEdit.range.start) - local end_pos = lsp_pos_to_vis_sel(textEdit.range['end']) - - -- convert the LSP range into a vis range - -- this destroys the current selection but we change it after the edit anyway - win.selection.anchored = false - win.selection:to(start_pos.line, start_pos.col) - win.selection.anchored = true - win.selection:to(end_pos.line, end_pos.col - 1) - local range = win.selection.range + local range = lsp_range_to_vis_range(win, textEdit.range) file:delete(range) file:insert(range.start, textEdit.newText) |
