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

Fix undotree() sequence number #2319

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@ichizok

ichizok commented Nov 11, 2017

Problem (reported by @machakann)

undotree().seq_cur shows wrong value after the certain operations.

Repro steps

vim --clean

:normal! Afoo
:normal! Abar
:undo
:normal! Abaz
:undo

then last undotree().seq_cur is:

expected: 1
actual: 2

[3] baz
 |[2] bar
 |/
[1] foo
[0]

In detail:
When going back to the common parent node from branches, seq_cur should be set to the parent node number, but just decreased.

Solution

  • Fetch seq_cur of the parent node instead of decreasing

Ozaki Kiichi

@codecov-io

This comment has been minimized.

codecov-io commented Nov 11, 2017

Codecov Report

Merging #2319 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2319      +/-   ##
==========================================
+ Coverage   74.45%   74.48%   +0.02%     
==========================================
  Files          90       90              
  Lines      132145   132148       +3     
  Branches    29017    29019       +2     
==========================================
+ Hits        98394    98425      +31     
+ Misses      33722    33698      -24     
+ Partials       29       25       -4
Impacted Files Coverage Δ
src/undo.c 82.26% <100%> (+0.22%) ⬆️
src/ex_cmds.c 77.78% <0%> (-0.09%) ⬇️
src/gui.c 47.39% <0%> (ø) ⬆️
src/gui_gtk_x11.c 47.7% <0%> (ø) ⬆️
src/os_unix.c 53.46% <0%> (+0.04%) ⬆️
src/term.c 50.94% <0%> (+0.05%) ⬆️
src/terminal.c 65.19% <0%> (+0.06%) ⬆️
src/window.c 81.48% <0%> (+0.09%) ⬆️
src/if_py_both.h 76.59% <0%> (+0.14%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 462455e...b3c5592. Read the comment docs.

@brammool brammool closed this in 80eaddd Nov 11, 2017

@ichizok ichizok deleted the ichizok:fix/undotree branch Nov 12, 2017

adizero pushed a commit to adizero/vim that referenced this pull request May 19, 2018

patch 8.0.1290: seq_cur of undotree() wrong after undo
Problem:    seq_cur of undotree() wrong after undo.
Solution:   Get the actual sequence number instead of decrementing the current
            one. (Ozaki Kiichi, closes vim#2319)

janlazo added a commit to janlazo/neovim that referenced this pull request Aug 9, 2018

vim-patch:8.0.1290: seq_cur of undotree() wrong after undo
Problem:    seq_cur of undotree() wrong after undo.
Solution:   Get the actual sequence number instead of decrementing the current
            one. (Ozaki Kiichi, closes vim/vim#2319)
vim/vim@80eaddd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment