-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undo deleted lines mixes order #345
Comments
I can reproduce this issue on nvim v0.3.4, nvim 0.4.3 and vim 8.1.2292. |
Happens for me also, in many cases. |
Does anyone know of a workaround? |
Have observed this every time for an one line change. Undo hunk just works incorrectly in that case as described. |
same for me |
Same here. |
Merged
KapJI
added a commit
to KapJI/vim-signify
that referenced
this issue
Jan 22, 2021
Fixes mhinz#345 When `new_count` is `0` it's a special case meaning that lines should be inserted after `new_line`, not instead of it. When you remove `line 2` from file: ``` line 1 line 2 line 3 line 4 ``` the diff looks line this: ```diff index 9c2a709..cbf7f40 100644 --- a/test.txt +++ b/test.txt @@ -2 +1,0 @@ line 1 -line 2 ``` It means `line 2` in `undo` should be inserted below line 1 (`new_line`) and before it was inserted after line 0 (`new_line - 1`).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am pretty sure, that this one cannot be a general issue and it is related to my environment.
Starting point:
I delete line 3:
:SignifyHunkDiff
on line 2 shows:If I now do
:SignifyHunkUndo
on line 2, I get:Deleted line is added above although it was deleted below. So the order is not correct anymore.
Not to deep into it, so I simply changed
vim-signify/autoload/sy/repo.vim
like this:without being confident, this is it. In the end, it fixed the actual issue, but with this revoking changes on a line does not work any longer:
Hunk:
Undo:
Error:
Anyhow, probably it is a special issue on my environment and someone can help me to find out, what is wrong. In the other case, no one is apparently using the undo to get back deleted lines 🙂
The text was updated successfully, but these errors were encountered: