[vim/vim] Patch 863 has broken error highlighting when termguicolors is set (#6207)

7 views
Skip to first unread message

Wu Yongwei

unread,
Jun 5, 2020, 7:51:29 AM6/5/20
to vim/vim, Subscribed

Description
Console Vim 8 versions up to 8.2.862 can show a red background on spelling errors (and other errors some plug-ins choose to highlight). The red background is gone from the terminal unless termguicolors is reset.

To Reproduce
Detailed steps to reproduce the behavior:

  1. Run vim --clean in a console
  2. Type a wrongly spelt word
  3. Use ":set spell" to highlight the wrong spelling
  4. Use ":set termguicolors" to enable true colours (in a compatible terminal)
  5. Observe the red background is now gone

Expected behavior
Error highlighting like 8.2.862 regardless of the termguicolors setting.

Environment

  • Vim version 8.2.863 onwards, compiled from source, huge version
  • OS: Tested on SUSE Linux
  • Terminal: Tested on mintty


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,
Jun 5, 2020, 12:54:44 PM6/5/20
to vim/vim, Subscribed


> **Description**

> Console Vim 8 versions up to 8.2.862 can show a red background on spelling errors (and other errors some plug-ins choose to highlight). The red background is gone from the terminal unless termguicolors is reset.
>
> **To Reproduce**

> Detailed steps to reproduce the behavior:
> 1. Run `vim --clean` in a console
> 2. Type a wrongly spelt word
> 3. Use ":set spell" to highlight the wrong spelling
> 4. Use ":set termguicolors" to enable true colours (in a compatible terminal)
> 5. Observe the red background is now gone
>
> **Expected behavior**

> Error highlighting like 8.2.862 regardless of the termguicolors setting.
>
> **Environment**
> - Vim version 8.2.863 onwards, compiled from source, huge version
> - OS: Tested on SUSE Linux
> - Terminal: Tested on mintty

I can reproduce it with xterm.

It looks like outputting the color for the underline (red) causes the
background color to be cleared. If you disable the termcap entry for
underline color it works again:
:set t_8u=

I would not call this a bug for Vim, but since apparently terminals have
this behavior, we need to work around it: If the cterm attributes do not
have "underline" or "undercurl" then do not output t_8u.

--
Error:015 - Unable to exit Windows. Try the door.

/// 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 ///

Bram Moolenaar

unread,
Jun 5, 2020, 1:37:50 PM6/5/20
to vim/vim, Subscribed

Closed #6207 via ea563cc.

Mateusz Okulus

unread,
Jun 5, 2020, 3:21:00 PM6/5/20
to vim...@googlegroups.com
Can't reproduce on vim 8.2.906

I have highlight with default and elford color schemes, with and
without termguicolors set using vim --clean.

I use st. TERM=st-256color
signature.asc
Reply all
Reply to author
Forward
0 new messages