[vim/vim] laststatus=2 breaks au InsertEnter * hi ModeMsg (#7751)

10 views
Skip to first unread message

Paul Swanson

unread,
Jan 28, 2021, 12:33:51 AM1/28/21
to vim/vim, Subscribed

Hello,

Given the following .vimrc in Vim 8.2:

set nocompatible
set laststatus=2
au InsertEnter * hi ModeMsg ctermfg=yellow

Upon entering insert mode for the first time, the ModeMsg foreground colour is unchanged; subsequent entries to insert mode see the ModeMsg foreground colour change to yellow as expected.

If the "set laststatus=2" line is removed or changed another valid value, the ModeMsg highlighting is changed on both initial and subsequent entries to insert mode, as expected.

This seems like a bug to me. Can anyone else confirm this behaviour?

Thanks in advance.

Paul Swanson


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Bram Moolenaar

unread,
Jan 28, 2021, 5:08:40 AM1/28/21
to vim/vim, Subscribed

Closed #7751 via 2e6cdb9.

Bram Moolenaar

unread,
Jan 28, 2021, 5:09:04 AM1/28/21
to vim/vim, Subscribed


Paul Swanson wrote:

> Given the following .vimrc in Vim 8.2:
>
> set nocompatible
> set laststatus=2
> au InsertEnter * hi ModeMsg ctermfg=yellow
>
> Upon entering insert mode for the first time, the ModeMsg foreground colour is unchanged; subsequent entries to insert mode see the ModeMsg foreground colour change to yellow as expected.
>
> If the "set laststatus=2" line is removed or changed another valid value, the ModeMsg highlighting is changed on both initial and subsequent entries to insert mode, as expected.
>
> This seems like a bug to me. Can anyone else confirm this behaviour?

It's more prominent if the highlight is reset in InsertLeave:


set laststatus=2
au InsertEnter * hi ModeMsg ctermfg=yellow
au InsertLeave * hi ModeMsg ctermfg=black

You can fix it by adding a redraw:

au InsertEnter * hi ModeMsg ctermfg=yellow | redraw
au InsertLeave * hi ModeMsg ctermfg=black | redraw

But I can change the code that takes care of it.

--
hundred-and-one symptoms of being an internet addict:
253. You wait for a slow loading web page before going to the toilet.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Paul Swanson

unread,
Jan 29, 2021, 3:34:25 AM1/29/21
to vim...@googlegroups.com
Thanks for your prompt help with that, Bram.

Sincerely,

Paul Swanson

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> --
>
> --
>
> You received this message from the "vim_dev" maillist.
>
> Do not top-post! Type your reply below the text you are replying to.
>
> For more information, visit http://www.vim.org/maillist.php
>
> ---
>
> You received this message because you are subscribed to the Google Groups "vim_dev" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/7751/768944646%40github.com.
Reply all
Reply to author
Forward
0 new messages