-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(text_edit): discarded change from the initial buffer (#1552)
* 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
- Loading branch information
Showing
2 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters