-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 calls changed_lines before on_bytes #26499
Comments
Why isn't |
zeertzjq
added a commit
to zeertzjq/neovim
that referenced
this issue
Mar 29, 2024
zeertzjq
added a commit
to zeertzjq/neovim
that referenced
this issue
Mar 29, 2024
zeertzjq
added a commit
to zeertzjq/neovim
that referenced
this issue
Mar 29, 2024
zeertzjq
added a commit
that referenced
this issue
Mar 30, 2024
huangyingw
pushed a commit
to huangyingw/neovim
that referenced
this issue
May 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Undo (
u
) callschanged_lines()
before adjusting extmarks (which triggerson_bytes
):neovim/src/nvim/undo.c
Lines 2378 to 2430 in 096211a
Normally,
changed_lines()
should be called after adjusting extmarks. This order is important because the result ofchanged_lines()
may depend on the result ofon_bytes
. For example,changed_lines()
updates folds, and the treesitter folding shifts foldlevels inon_bytes
. So ifchanged_lines()
is called beforeon_bytes
, the folds can be wrong. See also #26364.Steps to reproduce
repro.vim
foldexpr 1
to:mess
o<Esc>
.This prints the following to
:mess
, in the correct order.u
.This prints the following to
:mess
, in the wrong order.Expected behavior
on_bytes, then foldexpr
Neovim version (nvim -v)
2ebd328
Vim (not Nvim) behaves the same?
N/A
Operating system/version
ubuntu 23.10
Terminal name/version
GNOME Terminal 3.49.92 using VTE 0.74.0 +BIDI +GNUTLS +ICU +SYSTEMD
$TERM environment variable
tmux-256color
Installation
build from repo
The text was updated successfully, but these errors were encountered: