summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-10-16 22:13:00 +0200
committerBram Moolenaar <Bram@vim.org>2018-10-16 22:13:00 +0200
commit29e7fe55becd96ba812297de06cec06ea7e79892 (patch)
tree598245dbcc33ea0d28e5f7fa3a855be70b223d7c /src
parentb361db077ffb9669147d3ff1cc0191154f7289e4 (diff)
downloadvim-git-29e7fe55becd96ba812297de06cec06ea7e79892.tar.gz
patch 8.1.0481: when "Terminal" highlight is reverted cursor doesn't showv8.1.0481
Problem: When "Terminal" highlight is reverted cursor doesn't show. Solution: Get the colors of the "Terminal" group. (closes #3546)
Diffstat (limited to 'src')
-rw-r--r--src/terminal.c21
-rw-r--r--src/version.c2
2 files changed, 21 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 0c7630c62..4e62253d5 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -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;
}
- *fg = gui.back_pixel;
+
+ /* 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)
- *bg = gui.norm_pixel;
+ {
+ if (id != 0)
+ *bg = term_fg;
+ else
+ *bg = gui.norm_pixel;
+ }
else
*bg = color_name2handle(term->tl_cursor_color);
entry.name = "n";
diff --git a/src/version.c b/src/version.c
index 1eab778c9..dada7a7fe 100644
--- a/src/version.c
+++ b/src/version.c
@@ -793,6 +793,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 481,
+/**/
480,
/**/
479,