Open PowerUser64 opened 1 month ago
Thanks for the issue!
'mini.operators' does the best I could find to not have any side effects. It uses marks x
and y
as temporary marks for a more proper yanking of selected pair of text regions. They are restored to what they were prior to exchange.
Expected behavior
mini.operators should leave marks the same as they were before the edit was performed, and not re-place them when an edit is undone.
Actual behavior
mini.operators currently causes the
x
andy
marks to be replaced when undoing a change done by the exchange operation.
So it does leave them as they were before the edit. Undoing the edit is not done by 'mini.operators' itself, so it has little control over it.
I'll take a look if it is feasible for "exchange" to do its edit in a way that works with this "undo" use case, but I'd say that this both 1) doesn't look like a huge issue; and 2) may be very convoluted to actually achieve.
Contributing guidelines
Module(s)
mini.operators
Description
mini.operators' exchange function leaves behind marks when undoing.
Neovim version
0.10.0
Steps to reproduce
mini.operators bug.webm
(good so far)
oh no, we now have two marks on this line (
x
andy
)!Note that here,
marks.nvim
is used to display (and later delete) the marks that the exchange operation leaves behind, but it is reproducible without it.Expected behavior
mini.operators should leave marks the same as they were before the edit was performed, and not re-place them when an edit is undone.
Actual behavior
mini.operators currently causes the
x
andy
marks to be replaced when undoing a change done by the exchange operation.