terminal: Redraw statusline on title change #8973

The statusline may incorporate b:term_title, so redraw it when that
title changes.

Introduce a new function status_redraw_buf to redraw windows associated
with the current buffer.
This commit is contained in:
Josh Triplett 2018-09-09 15:14:14 -07:00 committed by Justin M. Keyes
parent 7862c3ae3e
commit 8240b8b596
2 changed files with 10 additions and 5 deletions

View File

@ -4588,14 +4588,18 @@ void status_redraw_all(void)
} }
} }
/* /// Marks all status lines of the current buffer for redraw.
* mark all status lines of the current buffer for redraw
*/
void status_redraw_curbuf(void) void status_redraw_curbuf(void)
{
status_redraw_buf(curbuf);
}
/// Marks all status lines of the specified buffer for redraw.
void status_redraw_buf(buf_T *buf)
{ {
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (wp->w_status_height != 0 && wp->w_buffer == curbuf) { if (wp->w_status_height != 0 && wp->w_buffer == buf) {
wp->w_redr_status = TRUE; wp->w_redr_status = true;
redraw_later(VALID); redraw_later(VALID);
} }
} }

View File

@ -668,6 +668,7 @@ static void buf_set_term_title(buf_T *buf, char *title)
false, false,
&err); &err);
api_clear_error(&err); api_clear_error(&err);
status_redraw_buf(buf);
} }
static int term_settermprop(VTermProp prop, VTermValue *val, void *data) static int term_settermprop(VTermProp prop, VTermValue *val, void *data)