mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
* fix(text_edit): discarded change from the initial buffer When multiple calls to apply_text_edits, the changes made to the current buffer are discarded if the following text_edit concerns a file that is not in the buffer list. The problem comes from the _switch function, which executes `edit!` when it detects that the target is not in the buffer list. If a change was made to the current buffer before that, that change is discarded (definition of `edit!`). The fix consists of a different logic: when _switch detects that the target is not in the buffer list, it calls `badd` prior to switching to the buffer that has just been added. No more `edit!`, no more discarded changes. The added test fails without the patch in the _switch function. * use better way to have a named buffer