summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-05-03 20:40:38 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-03 20:40:38 +0200
commitad431995721b2a886f789e2ea7db4c84b732eb18 (patch)
treecf5e87b996a15e384095f2163f1d32ce04bc682b /src/terminal.c
parentdf36514a6455342e178af693553ef9df9fcf8c83 (diff)
downloadvim-git-ad431995721b2a886f789e2ea7db4c84b732eb18.tar.gz
patch 8.2.2830: terminal colors are not updated when 'background' is setv8.2.2830
Problem: Terminal colors are not updated when 'background' is set. Solution: Call term_update_colors() for all terminals. (Marcin Szamotulski, closes #8171, closes #8150)
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/terminal.c b/src/terminal.c
index ce9f64be1..7fbff4617 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -4590,9 +4590,9 @@ create_vterm(term_T *term, int rows, int cols)
* Called when 'wincolor' was set.
*/
void
-term_update_colors(void)
+term_update_colors(term_T *term)
{
- term_T *term = curwin->w_buffer->b_term;
+ win_T *wp;
if (term->tl_vterm == NULL)
return;
@@ -4602,7 +4602,21 @@ term_update_colors(void)
&term->tl_default_color.fg,
&term->tl_default_color.bg);
- redraw_later(NOT_VALID);
+ FOR_ALL_WINDOWS(wp)
+ if (wp->w_buffer == term->tl_buffer)
+ redraw_win_later(wp, NOT_VALID);
+}
+
+/*
+ * Called when 'background' was set.
+ */
+ void
+term_update_colors_all(void)
+{
+ term_T *tp;
+
+ FOR_ALL_TERMS(tp)
+ term_update_colors(tp);
}
/*
@@ -5939,7 +5953,7 @@ f_term_list(typval_T *argvars UNUSED, typval_T *rettv)
l = rettv->vval.v_list;
FOR_ALL_TERMS(tp)
- if (tp != NULL && tp->tl_buffer != NULL)
+ if (tp->tl_buffer != NULL)
if (list_append_number(l,
(varnumber_T)tp->tl_buffer->b_fnum) == FAIL)
return;