mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.1.0481: when "Terminal" highlight is reverted cursor doesn't show
Problem: When "Terminal" highlight is reverted cursor doesn't show. Solution: Get the colors of the "Terminal" group. (closes #3546)
This commit is contained in:
parent
b361db077f
commit
29e7fe55be
@ -1953,6 +1953,8 @@ term_get_cursor_shape(guicolor_T *fg, guicolor_T *bg)
|
||||
{
|
||||
term_T *term = in_terminal_loop;
|
||||
static cursorentry_T entry;
|
||||
int id;
|
||||
guicolor_T term_fg, term_bg;
|
||||
|
||||
vim_memset(&entry, 0, sizeof(entry));
|
||||
entry.shape = entry.mshape =
|
||||
@ -1966,9 +1968,24 @@ term_get_cursor_shape(guicolor_T *fg, guicolor_T *bg)
|
||||
entry.blinkon = 400;
|
||||
entry.blinkoff = 250;
|
||||
}
|
||||
|
||||
/* The "Terminal" highlight group overrules the defaults. */
|
||||
id = syn_name2id((char_u *)"Terminal");
|
||||
if (id != 0)
|
||||
{
|
||||
syn_id2colors(id, &term_fg, &term_bg);
|
||||
*fg = term_bg;
|
||||
}
|
||||
else
|
||||
*fg = gui.back_pixel;
|
||||
|
||||
if (term->tl_cursor_color == NULL)
|
||||
{
|
||||
if (id != 0)
|
||||
*bg = term_fg;
|
||||
else
|
||||
*bg = gui.norm_pixel;
|
||||
}
|
||||
else
|
||||
*bg = color_name2handle(term->tl_cursor_color);
|
||||
entry.name = "n";
|
||||
|
@ -792,6 +792,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
481,
|
||||
/**/
|
||||
480,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user