macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.47k stars 680 forks source link

constant flickering when entering normal mode commands #1365

Closed fs111 closed 2 weeks ago

fs111 commented 1 year ago

Steps to reproduce

Whenever I do any normal mode command in the terminal the screen is flickering while it is being redrawn. This only started happening after the latest upgrade.

Attached is a scaled down gif that shows the behavior.

Screen Recording 2023-02-10 at 13 37 31

Expected behaviour

no flickering at all

Version of Vim and architecture

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Feb 7 2023 12:17:42) macOS version - x86_64 Included patches: 1-1276 Compiled by GitHub Actions Huge version with MacVim GUI. Features included (+) or not (-):

Environment

macOS Monterey, X86_64 (Intel) Terminal: iterm2 Build 3.4.19 xterm-256color GNU bash, version 5.2.9(1)-release (x86_64-apple-darwin21.3.0)

How MacVim was installed

official installer

Logs and stack traces

No response

Vim configuration where issue is reproducable

https://github.com/fs111/dotvim/blob/master/vimrc

Issue has been tested with given configuration

Issue has been tested with no configuration

Other conditions

fs111 commented 1 year ago

meh, I did build of upstream vim and the problem is there too. The problem must have started in between the current and latest upstream patches. Fun..

ychin commented 1 year ago

Hmm, I'm not quite seeing the flickering. I only tested on Apple Terminal and iTerm 3.5.0beta9 instead of iTerm 3.4.19 but I don't imagine the minor version difference matters.

I didn't test your vimrc fully because I didn't want to install all the plugins. I think it could be useful (you would get the same feedbacks as well if you file an issue at upstream Vim itself which you probably should do if you confirmed that this is an upstream issue) if you can isolate which command / plugin causes the flickering, since most people won't want to do the binary search themselves. (It would at least be useful to confirm that it's a plugin, because I don't think the flickering happens without the installed plugins)

ychin commented 1 year ago

Any update on this @fs111 ? I'm still not seeing this flickering so I'm wondering if you are still seeing this.

fs111 commented 1 year ago

@ychin ah, sorry no. Life got in the way. I will try to find some time to get to the bottom of it in the coming days

fs111 commented 1 year ago

@ychin Looks like it is the combination of the latest vim and https://github.com/gelguy/wilder.nvim I tried it with neovim and that works fine. I will check with the plugin author if something can be done at their end.

ychin commented 1 year ago

This may not be what you want to hear but I tried out wilder with a replicated setup similar to your vimrc and didn't quite see the flickering, in GUI, Apple Terminal, and iTerm. I'm using macOS Ventura though. But yeah maybe you may want to see if others have the same issue as you. I wonder if it's some interaction with some other plugins or some Vim features etc.

ychin commented 1 year ago

Hi @fs111 sorry I lied! I managed to repro it. I think I just didn't set it up properly. I did a quick Git bisect and found the issue was Vim v9.0.0993 (89469d157). I haven't taken a close look yet but seems like something changed in that commit where Vim tends to prefer to do full redraws which is why the screen flickers.

May want to follow up with either Vim or the plugin to see if there is a way to resole this.

fs111 commented 1 year ago

Thank you @ychin for spending the time. I will open an issue with the wilder project and see what they have to say.