Skip to content
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

nvim__redraw causes some visible screen tearing #28668

Closed
gpanders opened this issue May 8, 2024 · 4 comments
Closed

nvim__redraw causes some visible screen tearing #28668

gpanders opened this issue May 8, 2024 · 4 comments
Labels
bug issues reporting wrong behavior has:bisected issue has been tracked to a specific commit
Milestone

Comments

@gpanders
Copy link
Member

gpanders commented May 8, 2024

Problem

Since 037ea6e, Nvim occasionally exhibits some black "tearing"/flickering on startup.

It is difficult to capture so I recorded a slow motion video on my phone:

Before (no black tearing):

good.mov

After (with black tearing):

bad.mov

Note that in both cases we can see the screen state being drawn incrementally, but in the latter video the background of the top half of the screen becomes black first. In real time this has a noticeable "flicker" effect.

Steps to reproduce

In my case this seems to be caused by the nvim__redraw call in the Tree-sitter highlighter, so the following is sufficient to reproduce the issue:

cat >test.vim <<EOF
colorscheme blue
au FileType c lua vim.treesitter.start()
EOF
nvim --clean -u test.vim src/nvim/main.c

Expected behavior

The background should not become black when redrawing.

Neovim version (nvim -v)

064f3e4

Vim (not Nvim) behaves the same?

No

Operating system/version

macOS

Terminal name/version

Ghostty

$TERM environment variable

xterm-ghostty

Installation

Source

@gpanders gpanders added bug issues reporting wrong behavior has:bisected issue has been tracked to a specific commit labels May 8, 2024
@gpanders
Copy link
Member Author

gpanders commented May 8, 2024

cc @luukvbaal

@gpanders
Copy link
Member Author

gpanders commented May 8, 2024

The specific cause seems to be the ui_flush() call at the end of nvim__redraw(), which was not present in nvim__buf_redraw_range().

@zeertzjq zeertzjq added this to the 0.10 milestone May 8, 2024
@zeertzjq
Copy link
Member

zeertzjq commented May 8, 2024

Hmm, it doesn't make sense to call ui_flush() if update_screen() isn't called.

@gpanders
Copy link
Member Author

Fixed by #28676.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior has:bisected issue has been tracked to a specific commit
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants