Patch 8.2.2830

8 views
Skip to first unread message

Bram Moolenaar

unread,
May 3, 2021, 2:42:32 PM5/3/21
to vim...@googlegroups.com

Patch 8.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)
Files: src/terminal.c, src/proto/terminal.pro, src/optionstr.c


*** ../vim-8.2.2829/src/terminal.c 2021-04-29 20:18:41.970795473 +0200
--- src/terminal.c 2021-05-03 20:37:05.952022907 +0200
***************
*** 4590,4598 ****
* Called when 'wincolor' was set.
*/
void
! term_update_colors(void)
{
! term_T *term = curwin->w_buffer->b_term;

if (term->tl_vterm == NULL)
return;
--- 4590,4598 ----
* Called when 'wincolor' was set.
*/
void
! term_update_colors(term_T *term)
{
! win_T *wp;

if (term->tl_vterm == NULL)
return;
***************
*** 4602,4608 ****
&term->tl_default_color.fg,
&term->tl_default_color.bg);

! redraw_later(NOT_VALID);
}

/*
--- 4602,4622 ----
&term->tl_default_color.fg,
&term->tl_default_color.bg);

! 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,5945 ****

l = rettv->vval.v_list;
FOR_ALL_TERMS(tp)
! if (tp != NULL && tp->tl_buffer != NULL)
if (list_append_number(l,
(varnumber_T)tp->tl_buffer->b_fnum) == FAIL)
return;
--- 5953,5959 ----

l = rettv->vval.v_list;
FOR_ALL_TERMS(tp)
! if (tp->tl_buffer != NULL)
if (list_append_number(l,
(varnumber_T)tp->tl_buffer->b_fnum) == FAIL)
return;
*** ../vim-8.2.2829/src/proto/terminal.pro 2020-09-11 20:36:32.462574370 +0200
--- src/proto/terminal.pro 2021-05-03 20:36:49.428032853 +0200
***************
*** 19,24 ****
--- 19,25 ----
int term_use_loop(void);
void term_win_entered(void);
int terminal_loop(int blocking);
+ void set_terminal_default_colors(int cterm_fg, int cterm_bg);
int may_close_term_popup(void);
void term_channel_closed(channel_T *ch);
void term_check_channel_closed_recently(void);
***************
*** 28,37 ****
int term_show_buffer(buf_T *buf);
void term_change_in_curbuf(void);
int term_get_attr(win_T *wp, linenr_T lnum, int col);
! void term_update_colors(void);
char_u *term_get_status_text(term_T *term);
int set_ref_in_term(int copyID);
- void set_terminal_default_colors(int cterm_fg, int cterm_bg);
void f_term_dumpwrite(typval_T *argvars, typval_T *rettv);
int term_swap_diff(void);
void f_term_dumpdiff(typval_T *argvars, typval_T *rettv);
--- 29,38 ----
int term_show_buffer(buf_T *buf);
void term_change_in_curbuf(void);
int term_get_attr(win_T *wp, linenr_T lnum, int col);
! void term_update_colors(term_T *term);
! void term_update_colors_all(void);
char_u *term_get_status_text(term_T *term);
int set_ref_in_term(int copyID);
void f_term_dumpwrite(typval_T *argvars, typval_T *rettv);
int term_swap_diff(void);
void f_term_dumpdiff(typval_T *argvars, typval_T *rettv);
*** ../vim-8.2.2829/src/optionstr.c 2021-04-16 19:58:15.911249735 +0200
--- src/optionstr.c 2021-05-03 20:31:10.812379802 +0200
***************
*** 908,913 ****
--- 908,916 ----
init_highlight(FALSE, FALSE);
}
#endif
+ #ifdef FEAT_TERMINAL
+ term_update_colors_all();
+ #endif
}
else
errmsg = e_invarg;
***************
*** 2176,2182 ****
else if (varp == &curwin->w_p_wcr)
{
if (curwin->w_buffer->b_term != NULL)
! term_update_colors();
}
# if defined(MSWIN)
// 'termwintype'
--- 2179,2185 ----
else if (varp == &curwin->w_p_wcr)
{
if (curwin->w_buffer->b_term != NULL)
! term_update_colors(curwin->w_buffer->b_term);
}
# if defined(MSWIN)
// 'termwintype'
*** ../vim-8.2.2829/src/version.c 2021-05-03 20:01:40.805808533 +0200
--- src/version.c 2021-05-03 20:39:53.843869347 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2830,
/**/

--
hundred-and-one symptoms of being an internet addict:
226. You sit down at the computer right after dinner and your spouse
says "See you in the morning."

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages