Hello, @brammool
It's again that 'annoying' guy that is not happy with the current state of screen clearing/redrawing in vim and related issue #8002
I did more investigations, and have found that 'flickering' that i described caused by some CursorMoved autocommands (matchparen plugin, + I use popular lsp plugin coc.nvim that has some CursorMoved autocmds too) or some heavy calculations in statusline.
You can test it youself:
func! HeavyFunc() abort let x = 0 for i in range(1, 8000) let x += 1 endfor endfunc
autocmd CursorMoved * call HeavyFunc() or set statusline=%{HeaveFunc()}C-fflickering or if HeavyFunc() is too slow even visible slow redraws of the screen.So after my investigations what i understand the logic to clear and redraw the screen is:
Maybe it is possible to swap calculation of autocmds/statusline etc and clearing the screen? So it would be like
Any limitations to achieve this?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
So the question is is there any particular benefit of clearing whole screen before drawing it?
Is it faster, removes some possible left over artifacts? Any other reason?
And one of any of the questions above are important, why then if you split and make one window height only 1 line it doesn't require to clear the whole screen on big jumps (I understand that there different logic in implementations, I just don't understand why it requires in one situation, but not the other?) It is definitely that statusline after the jump would not go anywhere from your screen, so there is no reason to remove it in between screen drawing.
If omitting that and displaying the text on top of what is there already
would avoid it
That what I personally would like to have, but not sure about any issues or shortcomings this could strike with.
If you have time, can you explain or link to some resource, why screen should be cleared before drawing new info. Or this is just a strategy you have selected?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Hello, @brammool
I have finally tracked this issue. Sorry for a lot of misleading recently.
I'm not sure why I didn't test it before, but option termguicolors and colorscheme with it support caused such flickering that i have described. Didn't test it before, because my colorscheme is gui only and not cterm.
Now i can fully reproduce with vim --clean -c "set nu rnu termguicolors laststatus=2" and open some big file and scroll with pressed C-f C-b causes a lot of statusline flickering. And :redraw! are sometimes flickers too (visible to an eye), but with notermguicolors redraw! my eye can't catch it.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
One thing you can do is using the "script" program. Run "script", edit some file with Vim that causes flicker, then exit Vim and exit script. Then the file "typescript" will show what was sent to the terminal. Perhaps that sows something.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
While recording this logs have found that set t_ut= suggested by @lacygoill #8002 (comment) helped to completely remove flickering with vim --clean and other builtin colorschemes besides default one. But still have no impact to my config.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@brammool sorry for wasting so much of your time.
My full config with only changed colorscheme to any of builtin ones and set t_ut= option completely removed flickering for me.
Thank You.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #10574 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Have tracked the issue.
Having Normal highlight with guibg=NONE and relate on the terminal background color caused such flickering.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()