Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim.exe to 24bit color #2060

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions runtime/doc/options.txt
Expand Up @@ -7872,15 +7872,16 @@ A jump table for the options with a short description can be found at |Q_op|.
:set encoding=utf-8
< You need to do this when your system has no locale support for UTF-8.

*'termguicolors'* *'tgc'*
*'termguicolors'* *'tgc'* *E949*
'termguicolors' 'tgc' boolean (default off)
global
{not in Vi}
{not available when compiled without the
|+termguicolors| feature}
When on, uses |highlight-guifg| and |highlight-guibg| attributes in
the terminal (thus using 24-bit color). Requires a ISO-8613-3
compatible terminal.
compatible terminal. For Win32 console, Windows 10 version 1703
(Creators Update) or later is required.
If setting this option does not work (produces a colorless UI)
reading |xterm-true-color| might help.
Note that the "cterm" attributes are still used, not the "gui" ones.
Expand Down
15 changes: 15 additions & 0 deletions src/misc1.c
Expand Up @@ -3701,7 +3701,22 @@ vim_beep(
&& !(gui.in_use && gui.starting)
#endif
)
{
out_str_cf(T_VB);
#if defined(WIN3264) && !defined(FEAT_GUI)
/* No restore color information, refresh the screen. */
if (vtp_get_stat() != 0
# ifdef FEAT_TERMGUICOLORS
&& p_tgc
# endif
)
{
redraw_later(CLEAR);
update_screen(0);
redrawcmd();
}
#endif
}
else
out_char(BELL);
#ifdef ELAPSED_FUNC
Expand Down
15 changes: 15 additions & 0 deletions src/option.c
Expand Up @@ -8654,10 +8654,25 @@ set_bool_option(
/* 'termguicolors' */
else if ((int *)varp == &p_tgc)
{
# if !defined(FEAT_GUI) && defined(WIN3264)
/* Do not turn on 'tgc' when 24-bit colors are not supported. */
if (!vtp_get_stat())
{
p_tgc = 0;
return (char_u*)N_("E949: 24-bit colors are not supported on this environment");
}
swap_tcap();
# endif
# ifdef FEAT_GUI
if (!gui.in_use && !gui.starting)
# endif
highlight_gui_started();
# if !defined(FEAT_GUI) && defined(WIN3264)
control_console_color_rgb();
/* reset t_Co */
if (STRCMP(T_NAME, "win32") == 0)
set_termname(T_NAME);
# endif
}
#endif

Expand Down