Mercurial > vim
comparison src/terminal.c @ 24582:1a658c5eb326 v8.2.2830
patch 8.2.2830: terminal colors are not updated when 'background' is set
Commit: https://github.com/vim/vim/commit/ad431995721b2a886f789e2ea7db4c84b732eb18
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 3 20:40:38 2021 +0200
patch 8.2.2830: terminal colors are not updated when 'background' is set
Problem: Terminal colors are not updated when 'background' is set.
Solution: Call term_update_colors() for all terminals. (Marcin Szamotulski,
closes #8171, closes #8150)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 03 May 2021 20:45:04 +0200 |
parents | 7a4cc4d3a40a |
children | d957c7bbacf3 |
comparison
equal
deleted
inserted
replaced
24581:4cb7be47fa3d | 24582:1a658c5eb326 |
---|---|
4588 | 4588 |
4589 /* | 4589 /* |
4590 * Called when 'wincolor' was set. | 4590 * Called when 'wincolor' was set. |
4591 */ | 4591 */ |
4592 void | 4592 void |
4593 term_update_colors(void) | 4593 term_update_colors(term_T *term) |
4594 { | 4594 { |
4595 term_T *term = curwin->w_buffer->b_term; | 4595 win_T *wp; |
4596 | 4596 |
4597 if (term->tl_vterm == NULL) | 4597 if (term->tl_vterm == NULL) |
4598 return; | 4598 return; |
4599 init_default_colors(term, curwin); | 4599 init_default_colors(term, curwin); |
4600 vterm_state_set_default_colors( | 4600 vterm_state_set_default_colors( |
4601 vterm_obtain_state(term->tl_vterm), | 4601 vterm_obtain_state(term->tl_vterm), |
4602 &term->tl_default_color.fg, | 4602 &term->tl_default_color.fg, |
4603 &term->tl_default_color.bg); | 4603 &term->tl_default_color.bg); |
4604 | 4604 |
4605 redraw_later(NOT_VALID); | 4605 FOR_ALL_WINDOWS(wp) |
4606 if (wp->w_buffer == term->tl_buffer) | |
4607 redraw_win_later(wp, NOT_VALID); | |
4608 } | |
4609 | |
4610 /* | |
4611 * Called when 'background' was set. | |
4612 */ | |
4613 void | |
4614 term_update_colors_all(void) | |
4615 { | |
4616 term_T *tp; | |
4617 | |
4618 FOR_ALL_TERMS(tp) | |
4619 term_update_colors(tp); | |
4606 } | 4620 } |
4607 | 4621 |
4608 /* | 4622 /* |
4609 * Return the text to show for the buffer name and status. | 4623 * Return the text to show for the buffer name and status. |
4610 */ | 4624 */ |
5937 if (rettv_list_alloc(rettv) == FAIL || first_term == NULL) | 5951 if (rettv_list_alloc(rettv) == FAIL || first_term == NULL) |
5938 return; | 5952 return; |
5939 | 5953 |
5940 l = rettv->vval.v_list; | 5954 l = rettv->vval.v_list; |
5941 FOR_ALL_TERMS(tp) | 5955 FOR_ALL_TERMS(tp) |
5942 if (tp != NULL && tp->tl_buffer != NULL) | 5956 if (tp->tl_buffer != NULL) |
5943 if (list_append_number(l, | 5957 if (list_append_number(l, |
5944 (varnumber_T)tp->tl_buffer->b_fnum) == FAIL) | 5958 (varnumber_T)tp->tl_buffer->b_fnum) == FAIL) |
5945 return; | 5959 return; |
5946 } | 5960 } |
5947 | 5961 |