You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mini.operators' exchange function leaves behind marks when undoing.
Neovim version
0.10.0
Steps to reproduce
mini.operators.bug.webm
gxE (start exchange)
WW (go to the next thing we want to exchange)
. (run the exchange operation)
(good so far)
u (undo the exchange)
oh no, we now have two marks on this line (x and y)!
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 and y marks to be replaced when undoing a change done by the exchange operation.
The text was updated successfully, but these errors were encountered:
'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 and y 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.The text was updated successfully, but these errors were encountered: