neovim
neovim copied to clipboard
message "Swap file xxx already exists" does not respect the MoreMsg highlight during startup
Neovim version (nvim -v)
0.5.1
Vim (not Nvim) behaves the same?
no, vim 8.2.3575
Operating system/version
Solus Linux
Terminal name/version
Alacritty 0.9.0
$TERM environment variable
alacritty
Installation
System package manager
How to reproduce the issue
This is the content of my init.vim file:
colorscheme nord
set termguicolors
Then I first open file a.cc in one nvim instance. Then I open another terminal and run nvim a.cc. The following is what I saw:

However, this is the MoreMsg highlight group defined by the nord colorscheme:

As can be seen, the highlight colors used by nvim for the Swap file xxxx already exists message does not match the MoreMsg highlight group defined by my colorscheme.
I did the same experiment with vim, with .vimrc identical to the init.vim shown above. This is the result in vim:

vim uses correct highlight colors for the Swap file xxxx already exists message.
Expected behavior
The highlight color for the Swap file xxxx already exists message should match the MoreMsg highlight group of the selected colorscheme.
Actual behavior
The highlight color for the Swap file xxxx already exists message do not match the MoreMsg highlight group of the selected colorscheme.
This only happens on startup. ~However, I roughly tested and it appears Vim behaves the same. Maybe there is some environment-related stuff affecting.~
@zeertzjq, did you use the minimum vimrc similar to what I used when you tested it? And what is the version of vim in your test. I believe my test result is not related to my environment settings because I have tried a minimum vimrc file and can reproduce the result on multiple machines.
I think what is important is that set termguicolors should appear after colorscheme xxx. This is the way to force vim to respect the MoreMsg highlight group when showing the Swap file xxx already exists message. However, it does not work for neovim. If we flip the order of the two commands, vim and neovim both behave in the wrong way (not taking the highlight group from my set colorscheme).
Oh, indeed Vim behaves correctly with set termguicolors after changing MoreMsg highlight group.
I think I'm having this problem as well. It didn't bother me previously, but with the new default colour scheme in neovim, the warning text is hard to read for me:
I think this is a pretty significant usability problem.
@dexgs try nvim --cmd "set bg=light"