[vim/vim] GUI: colors from the vimrc are shown only after a slow VimEnter (PR #20807)

4 views
Skip to first unread message

h_east

unread,
Jul 21, 2026, 6:56:12 PM (11 hours ago) Jul 21
to vim/vim, Subscribed
Problem:  In the GUI the colors set in the vimrc are not shown until the
          first redraw, which happens after the VimEnter autocommands.
          When a VimEnter autocommand is slow the window shows the
          default colors for a noticeable time, e.g. a white flash
          before a dark colorscheme.  Most noticeable on MS-Windows.
Solution: Draw the screen once before triggering the VimEnter
          autocommands, so the colors from the vimrc are shown right
          away.

fixes: #20757


In the GUI the colors set in the vimrc are only shown at the first redraw in
the main loop, which is after the VimEnter autocommands. A slow VimEnter
autocommand therefore leaves the window showing the default colors for a
noticeable time, for example a white flash before a dark colorscheme.

Drawing the screen once just before the VimEnter autocommands makes the vimrc
colors appear right away.

Confirmed on MS-Windows gVim. On GTK the drawing is not presented until the
GTK event loop runs, so there is no visible change there; the extra draw is
harmless.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20807

Commit Summary

  • 74032b8 GUI: colors from the vimrc are shown only after a slow VimEnter

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20807@github.com>

dezza

unread,
1:28 AM (4 hours ago) 1:28 AM
to vim/vim, Subscribed
dezza left a comment (vim/vim#20807)

I have a change in testing that also redraws when moving the window.

Just a heads up that this might be related to my GDK_PRIORITY_REDRAW condition from:
#20528

Taking note of this change, ping me if there's more redraw related changes coming for gui.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20807/c5042189675@github.com>

Christian Brabandt

unread,
5:01 AM (1 hour ago) 5:01 AM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20807)

Hm, could this cause some annoying highlighting changes? E.g. if the VimEnter autocommand changes the coloring (or background color), that would make a visible switch in the highlighting appearance for a user and might be a bit annoying?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20807/c5043917928@github.com>

Reply all
Reply to author
Forward
0 new messages