Need to redraw borders now when some things change. Also change default so that

the active border colour is different in a mode or with synchronize-panes on.
pull/2195/head
Nicholas Marriott 2020-04-29 08:55:21 +01:00
parent 2d151d8ca5
commit 3d76748161
8 changed files with 23 additions and 8 deletions

View File

@ -54,6 +54,7 @@ cmd_rename_window_exec(struct cmd *self, struct cmdq_item *item)
window_set_name(wl->window, newname);
options_set_number(wl->window->options, "automatic-rename", 0);
server_redraw_window_borders(wl->window);
server_status_window(wl->window);
free(newname);

View File

@ -91,7 +91,6 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
else
window_zoom(wp);
server_redraw_window(w);
server_status_window(w);
return (CMD_RETURN_NORMAL);
}
server_unzoom_window(w);

View File

@ -90,6 +90,7 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmdq_item *item)
}
wp->flags |= PANE_REDRAW;
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
environ_free(sc.environ);

View File

@ -193,8 +193,10 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'T')) {
title = format_single_from_target(item, args_get(args, 'T'));
if (screen_set_title(&wp->base, title))
if (screen_set_title(&wp->base, title)) {
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
}
free(title);
return (CMD_RETURN_NORMAL);
}

19
input.c
View File

@ -1859,8 +1859,10 @@ input_csi_dispatch_winops(struct input_ctx *ictx)
case 0:
case 2:
screen_pop_title(sctx->s);
if (wp != NULL)
if (wp != NULL) {
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
}
break;
}
break;
@ -2251,8 +2253,10 @@ input_exit_osc(struct input_ctx *ictx)
switch (option) {
case 0:
case 2:
if (screen_set_title(sctx->s, p) && wp != NULL)
server_status_window(ictx->wp->window);
if (screen_set_title(sctx->s, p) && wp != NULL) {
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
}
break;
case 4:
input_osc_4(ictx, p);
@ -2260,8 +2264,10 @@ input_exit_osc(struct input_ctx *ictx)
case 7:
if (utf8_isvalid(p)) {
screen_set_path(sctx->s, p);
if (wp != NULL)
if (wp != NULL) {
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
}
}
break;
case 10:
@ -2312,8 +2318,10 @@ input_exit_apc(struct input_ctx *ictx)
return;
log_debug("%s: \"%s\"", __func__, ictx->input_buf);
if (screen_set_title(sctx->s, ictx->input_buf) && wp != NULL)
if (screen_set_title(sctx->s, ictx->input_buf) && wp != NULL) {
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
}
}
/* Rename string started. */
@ -2353,6 +2361,7 @@ input_exit_rename(struct input_ctx *ictx)
}
window_set_name(wp->window, ictx->input_buf);
options_set_number(wp->window->options, "automatic-rename", 0);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
}

View File

@ -96,6 +96,7 @@ check_window_name(struct window *w)
if (strcmp(name, w->name) != 0) {
log_debug("@%u new name %s (was %s)", w->id, name, w->name);
window_set_name(w, name);
server_redraw_window_borders(w);
server_status_window(w);
} else
log_debug("@%u name not changed (still %s)", w->id, w->name);

View File

@ -717,7 +717,7 @@ const struct options_table_entry options_table[] = {
{ .name = "pane-active-border-style",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
.default_str = "fg=green",
.default_str = "#{?pane_in_mode,fg=yellow,#{?synchronize-panes,fg=red,,fg=green}}",
.flags = OPTIONS_TABLE_IS_STYLE,
.separator = ","
},

View File

@ -1109,6 +1109,7 @@ window_pane_set_mode(struct window_pane *wp, struct window_pane *swp,
wp->screen = wme->screen;
wp->flags |= (PANE_REDRAW|PANE_CHANGED);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
notify_pane("pane-mode-changed", wp);
@ -1140,6 +1141,7 @@ window_pane_reset_mode(struct window_pane *wp)
}
wp->flags |= (PANE_REDRAW|PANE_CHANGED);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
notify_pane("pane-mode-changed", wp);
}