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
Executing :undo! when not on latest change restores previous to target undo state.
Steps to reproduce
nvim --clean -u NONE.
Create undo history by typing:
2.1. A, one, <Esc>.
2.2. A, two, <Esc>.
2.3. A, three, <Esc>.
2.4. A, four, <Esc>.
2.5. A, five, <Esc>.
Press u. This will restore one two three four text in undo state 4.
Execute :undo! 3. It should restore one two three text in undo state 3, but restores one two text in undo state 2. Executing :echo undotree() confirms that states 3, 4, 5 are deleted.
Expected behavior
:undo! always restores target undo state while deleting all states after it.
Notes:
When step 3 is skipped and :undo! 3 is executed on latest undo state, everything works as expected.
Neovim version (nvim -v)
NVIM v0.9.0-dev-987+g371a74e4e
Vim (not Nvim) behaves the same?
No (doesn't have this functionality)
Operating system/version
EndeavourOS Linux x86_64 (6.1.11-arch1-1)
Terminal name/version
st-0.9
$TERM environment variable
st-256color
Installation
appimage
The text was updated successfully, but these errors were encountered:
zeertzjq
changed the title
:undo! leads to restoration of previous to target state when executed not on latest undo state:undo! doesn't treat number as documented
Jul 26, 2023
Describe the bug
Executing
:undo!
when not on latest change restores previous to target undo state.Steps to reproduce
nvim --clean -u NONE
.2.1.
A
,one
,<Esc>
.2.2.
A
,two
,<Esc>
.2.3.
A
,three
,<Esc>
.2.4.
A
,four
,<Esc>
.2.5.
A
,five
,<Esc>
.u
. This will restoreone two three four
text in undo state 4.:undo! 3
. It should restoreone two three
text in undo state 3, but restoresone two
text in undo state 2. Executing:echo undotree()
confirms that states 3, 4, 5 are deleted.Expected behavior
:undo!
always restores target undo state while deleting all states after it.Notes:
:undo! 3
is executed on latest undo state, everything works as expected.Neovim version (nvim -v)
NVIM v0.9.0-dev-987+g371a74e4e
Vim (not Nvim) behaves the same?
No (doesn't have this functionality)
Operating system/version
EndeavourOS Linux x86_64 (6.1.11-arch1-1)
Terminal name/version
st-0.9
$TERM environment variable
st-256color
Installation
appimage
The text was updated successfully, but these errors were encountered: