Closed tbruyelle closed 1 week ago
Hey @prabirshrestha, could you please review this PR ? As mentioned in the body, the test can reproduce the bug, so if you want to make sure that this bug exists, just pull and run the test, without the fix. Thanks in advance :pray:
Hey there, any chance to have a review for this PR plz ?
Merged. Thanks.
When multiple calls to the
apply_text_edits()
function are made, the changes made to the current buffer are discarded if the followingtext_edit
targets a file that is not in the buffer list.The problem comes from the
_switch
function, which executesedit!
when it detects that the target is not in the buffer list. If a change has already been made to the current buffer before that, that change is discarded (definition ofedit!
).The fix uses of a different logic: if
_switch
detects that the target is not in the buffer list, it callsbadd
before switching to the buffer that has just been added. No moreedit!
, no more discarded changes.The added test will fail without the patch in the
_switch
function.