Bug 2345889 - vim activates an odd color-scheme on key-press
Summary: vim activates an odd color-scheme on key-press
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Zdenek Dohnal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-02-15 05:53 UTC by Onyeibo Oku
Modified: 2025-02-25 07:21 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-25 07:21:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Screenshots just after loading a config file (168.94 KB, image/jpeg)
2025-02-15 06:14 UTC, Onyeibo Oku
no flags Details
Screenshot after pressing the arrow key (one second after loading) (125.94 KB, image/jpeg)
2025-02-15 06:18 UTC, Onyeibo Oku
no flags Details
.vimrc file (200 bytes, text/plain)
2025-02-20 15:28 UTC, Onyeibo Oku
no flags Details
/etc/vimrc (3.92 KB, text/plain)
2025-02-20 15:29 UTC, Onyeibo Oku
no flags Details

Description Onyeibo Oku 2025-02-15 05:53:20 UTC
On starting vim, everythiing looks okay until I press a key (any key), then the colors inverse (sort-of).  The result is not nice for the eyes.

Reproducible: Always

Steps to Reproduce:
1. Install recent Rawhide updates
2. open a text in vim
3. press any key
Actual Results:  
The color scheme changes to a strange inverse -- hurtful to the eyes

Expected Results:  
Retain default colors

vim-common.x86_64   2:9.1.1081-1.fc43  rawhide

Comment 1 Onyeibo Oku 2025-02-15 06:14:39 UTC
Created attachment 2076559 [details]
Screenshots just after loading a config file

Comment 2 Onyeibo Oku 2025-02-15 06:18:04 UTC
Created attachment 2076560 [details]
Screenshot after pressing the arrow key (one second after loading)

Comment 3 Zdenek Dohnal 2025-02-18 12:03:15 UTC
Hi,

I cannot reproduce the issue - I suspect the issue might be connected to additional syntax plugin or a different terminal.

Can you reproduce the issue when you open Vim this way:

$ vim -u NONE -U NONE -N -i NONE <.ini file>

What is your $TERM value?

Comment 4 Onyeibo Oku 2025-02-18 15:41:32 UTC
(In reply to Zdenek Dohnal from comment #3)

> $ vim -u NONE -U NONE -N -i NONE <.ini file>
This opens without the theme colors and stays that way. (No sudden change of colors)


> What is your $TERM value?
$ echo $TERM
foot

I am running minimal (server) version of Fedora (rawhide) with Sway WM.

Comment 5 Zdenek Dohnal 2025-02-19 06:02:37 UTC
So it really is caused by a plugin, maybe influenced by a different terminal (I have default xterm-256color) - do you have any additional plugin which is not shipped with Vim?

If you open the file normally, what's the output of ':scriptnames' command?

Additionally, are you able to get output of ':set ft?' without changing the colors? If not, what's its output anyway? In my case if I open a .ini file it is 'dosini'.

Comment 6 Onyeibo Oku 2025-02-19 15:43:02 UTC
(In reply to Zdenek Dohnal from comment #5)
> 
> If you open the file normally, what's the output of ':scriptnames' command?
:scriptnames
  1: /etc/vimrc
  2: /usr/share/vim/vim91/syntax/syntax.vim
  3: /usr/share/vim/vim91/syntax/synload.vim
  4: /usr/share/vim/vim91/syntax/syncolor.vim
  5: /usr/share/vim/vim91/colors/lists/default.vim
  6: /usr/share/vim/vim91/filetype.vim
  7: /usr/share/vim/vimfiles/ftdetect/nginx.vim
  8: /usr/share/vim/vimfiles/ftdetect/ninja.vim
  9: /usr/share/vim/vim91/syntax/dosini.vim
 10: /usr/share/vim/vim91/ftplugin.vim
 11: ~/.vimrc
 12: /usr/share/vim/vimfiles/plugin/cctree.vim
 13: /usr/share/vim/vim91/plugin/getscriptPlugin.vim
 14: /usr/share/vim/vim91/plugin/gzip.vim
 15: /usr/share/vim/vim91/plugin/logiPat.vim
 16: /usr/share/vim/vim91/plugin/manpager.vim
 17: /usr/share/vim/vim91/plugin/matchparen.vim
 18: /usr/share/vim/vim91/plugin/netrwPlugin.vim
 19: /usr/share/vim/vim91/pack/dist/opt/netrw/plugin/netrwPlugin.vim
 20: /usr/share/vim/vim91/plugin/openPlugin.vim
 21 A: /usr/share/vim/vim91/autoload/dist/vim9.vim
 22: /usr/share/vim/vim91/plugin/rrhelper.vim
 23: /usr/share/vim/vim91/plugin/spellfile.vim
 24: /usr/share/vim/vim91/plugin/tarPlugin.vim
 25: /usr/share/vim/vim91/plugin/tohtml.vim
 26: /usr/share/vim/vim91/plugin/tutor.vim
 27: /usr/share/vim/vim91/plugin/vimballPlugin.vim
 28: /usr/share/vim/vim91/plugin/zipPlugin.vim
 29: /usr/share/vim/vim91/ftplugin/dosini.vim

> 
> Additionally, are you able to get output of ':set ft?' without changing the
> colors? If not, what's its output anyway? In my case if I open a .ini file
> it is 'dosini'.

It is the same for .ini files

Comment 7 Onyeibo Oku 2025-02-19 15:43:02 UTC
(In reply to Zdenek Dohnal from comment #5)
> 
> If you open the file normally, what's the output of ':scriptnames' command?
:scriptnames
  1: /etc/vimrc
  2: /usr/share/vim/vim91/syntax/syntax.vim
  3: /usr/share/vim/vim91/syntax/synload.vim
  4: /usr/share/vim/vim91/syntax/syncolor.vim
  5: /usr/share/vim/vim91/colors/lists/default.vim
  6: /usr/share/vim/vim91/filetype.vim
  7: /usr/share/vim/vimfiles/ftdetect/nginx.vim
  8: /usr/share/vim/vimfiles/ftdetect/ninja.vim
  9: /usr/share/vim/vim91/syntax/dosini.vim
 10: /usr/share/vim/vim91/ftplugin.vim
 11: ~/.vimrc
 12: /usr/share/vim/vimfiles/plugin/cctree.vim
 13: /usr/share/vim/vim91/plugin/getscriptPlugin.vim
 14: /usr/share/vim/vim91/plugin/gzip.vim
 15: /usr/share/vim/vim91/plugin/logiPat.vim
 16: /usr/share/vim/vim91/plugin/manpager.vim
 17: /usr/share/vim/vim91/plugin/matchparen.vim
 18: /usr/share/vim/vim91/plugin/netrwPlugin.vim
 19: /usr/share/vim/vim91/pack/dist/opt/netrw/plugin/netrwPlugin.vim
 20: /usr/share/vim/vim91/plugin/openPlugin.vim
 21 A: /usr/share/vim/vim91/autoload/dist/vim9.vim
 22: /usr/share/vim/vim91/plugin/rrhelper.vim
 23: /usr/share/vim/vim91/plugin/spellfile.vim
 24: /usr/share/vim/vim91/plugin/tarPlugin.vim
 25: /usr/share/vim/vim91/plugin/tohtml.vim
 26: /usr/share/vim/vim91/plugin/tutor.vim
 27: /usr/share/vim/vim91/plugin/vimballPlugin.vim
 28: /usr/share/vim/vim91/plugin/zipPlugin.vim
 29: /usr/share/vim/vim91/ftplugin/dosini.vim

> 
> Additionally, are you able to get output of ':set ft?' without changing the
> colors? If not, what's its output anyway? In my case if I open a .ini file
> it is 'dosini'.

It is the same for .ini files

Comment 8 Zdenek Dohnal 2025-02-20 07:19:45 UTC
Can you upload your /etc/vimrc and and ~/.vimrc?

Either way, IMO the cause of the issue might be either your vimrc files, or /usr/share/vim/vimfiles/plugin/cctree.vim, which is not present in Fedora.

Please test the idea by adding 'finish' on a new line at the start of one of mentioned file and start vim opening .ini file, and see if the issue is present.

Comment 9 Onyeibo Oku 2025-02-20 15:28:28 UTC
Created attachment 2077232 [details]
.vimrc file

Comment 10 Onyeibo Oku 2025-02-20 15:29:33 UTC
Created attachment 2077233 [details]
/etc/vimrc

Comment 11 Onyeibo Oku 2025-02-20 15:37:25 UTC
(In reply to Zdenek Dohnal from comment #8)
> Can you upload your /etc/vimrc and and ~/.vimrc?

DONE

> Please test the idea by adding 'finish' on a new line at the start of one of
> mentioned file and start vim opening .ini file, and see if the issue is
> present.

The issue persists with 'finish' at the start of ~/.vimrc.
However, 'finish' at the start of /etc/vimrc removes syntax colors/highlighting completely -- the result is similar to #c4

Comment 12 Zdenek Dohnal 2025-02-24 09:51:42 UTC
Aha, we've misunderstood each other. Try the 'finish' trick (put the line at the start of file, open the .ini file, see if the issue persists, remove the line from file and move it to the next file on the list) on each file on the mentioned list:

  1: /etc/vimrc
  2: /usr/share/vim/vim91/syntax/syntax.vim
  3: /usr/share/vim/vim91/syntax/synload.vim
  4: /usr/share/vim/vim91/syntax/syncolor.vim
  5: /usr/share/vim/vim91/colors/lists/default.vim
  6: /usr/share/vim/vim91/filetype.vim
  7: /usr/share/vim/vimfiles/ftdetect/nginx.vim
  8: /usr/share/vim/vimfiles/ftdetect/ninja.vim
  9: /usr/share/vim/vim91/syntax/dosini.vim
 10: /usr/share/vim/vim91/ftplugin.vim
 11: ~/.vimrc
 12: /usr/share/vim/vimfiles/plugin/cctree.vim
 13: /usr/share/vim/vim91/plugin/getscriptPlugin.vim
 14: /usr/share/vim/vim91/plugin/gzip.vim
 15: /usr/share/vim/vim91/plugin/logiPat.vim
 16: /usr/share/vim/vim91/plugin/manpager.vim
 17: /usr/share/vim/vim91/plugin/matchparen.vim
 18: /usr/share/vim/vim91/plugin/netrwPlugin.vim
 19: /usr/share/vim/vim91/pack/dist/opt/netrw/plugin/netrwPlugin.vim
 20: /usr/share/vim/vim91/plugin/openPlugin.vim
 21 A: /usr/share/vim/vim91/autoload/dist/vim9.vim
 22: /usr/share/vim/vim91/plugin/rrhelper.vim
 23: /usr/share/vim/vim91/plugin/spellfile.vim
 24: /usr/share/vim/vim91/plugin/tarPlugin.vim
 25: /usr/share/vim/vim91/plugin/tohtml.vim
 26: /usr/share/vim/vim91/plugin/tutor.vim
 27: /usr/share/vim/vim91/plugin/vimballPlugin.vim
 28: /usr/share/vim/vim91/plugin/zipPlugin.vim
 29: /usr/share/vim/vim91/ftplugin/dosini.vim


I've checked your vimrc files - /etc/vimrc is the same as default one, and your ~/.vimrc does not make any difference to .ini file syntax highlighting, so I really suspect the one which is not from Fedora -  /usr/share/vim/vimfiles/plugin/cctree.vim .

I open /usr/share/sssd/cfg_rules.ini for testing, please see if you see the issue on this file as well.

Comment 13 Onyeibo Oku 2025-02-24 18:42:44 UTC
I am no longer seeing the issue after running another update yesterday. 

The version of vim is now 9.1.1122-1.fc43

Comment 14 Fedora Update System 2025-02-25 07:20:52 UTC
FEDORA-2025-722d5ca5b9 (vim-9.1.1122-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-722d5ca5b9

Comment 15 Zdenek Dohnal 2025-02-25 07:21:54 UTC
Ok, thank you for letting me know - patchlevel 1122 is already even in stable releases (only F42 is still pending, due beta freeze), so I close the bug as CURRENTRELEASE.


Note You need to log in before you can comment on or make changes to this bug.