mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Give status_save_old the client so it can do the reinit too.
This commit is contained in:
parent
b4f5b99e4b
commit
818fda0363
19
status.c
19
status.c
@ -323,18 +323,23 @@ status_free(struct client *c)
|
|||||||
|
|
||||||
/* Save as old status line. */
|
/* Save as old status line. */
|
||||||
static void
|
static void
|
||||||
status_save_old(struct status_line *sl)
|
status_save_old(struct client *c)
|
||||||
{
|
{
|
||||||
|
struct status_line *sl = &c->status;
|
||||||
|
|
||||||
if (sl->old_screen == NULL) {
|
if (sl->old_screen == NULL) {
|
||||||
sl->old_screen = xmalloc(sizeof *sl->old_screen);
|
sl->old_screen = xmalloc(sizeof *sl->old_screen);
|
||||||
memcpy(sl->old_screen, &sl->screen, sizeof *sl->old_screen);
|
memcpy(sl->old_screen, &sl->screen, sizeof *sl->old_screen);
|
||||||
|
screen_init(&c->status.screen, c->tty.sx, 1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free old status line. */
|
/* Free old status line. */
|
||||||
static void
|
static void
|
||||||
status_free_old(struct status_line *sl)
|
status_free_old(struct client *c)
|
||||||
{
|
{
|
||||||
|
struct status_line *sl = &c->status;
|
||||||
|
|
||||||
if (sl->old_screen != NULL) {
|
if (sl->old_screen != NULL) {
|
||||||
screen_free(sl->old_screen);
|
screen_free(sl->old_screen);
|
||||||
free(sl->old_screen);
|
free(sl->old_screen);
|
||||||
@ -361,7 +366,7 @@ status_redraw(struct client *c)
|
|||||||
int larrow, rarrow;
|
int larrow, rarrow;
|
||||||
|
|
||||||
/* Delete the saved status line, if any. */
|
/* Delete the saved status line, if any. */
|
||||||
status_free_old(sl);
|
status_free_old(c);
|
||||||
|
|
||||||
/* No status line? */
|
/* No status line? */
|
||||||
lines = status_line_size(c);
|
lines = status_line_size(c);
|
||||||
@ -629,9 +634,7 @@ status_message_set(struct client *c, const char *fmt, ...)
|
|||||||
int delay;
|
int delay;
|
||||||
|
|
||||||
status_message_clear(c);
|
status_message_clear(c);
|
||||||
|
status_save_old(c);
|
||||||
status_save_old(&c->status);
|
|
||||||
screen_init(&c->status.screen, c->tty.sx, 1, 0);
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
xvasprintf(&c->message_string, fmt, ap);
|
xvasprintf(&c->message_string, fmt, ap);
|
||||||
@ -744,9 +747,7 @@ status_prompt_set(struct client *c, const char *msg, const char *input,
|
|||||||
|
|
||||||
status_message_clear(c);
|
status_message_clear(c);
|
||||||
status_prompt_clear(c);
|
status_prompt_clear(c);
|
||||||
|
status_save_old(c);
|
||||||
status_save_old(&c->status);
|
|
||||||
screen_init(&c->status.screen, c->tty.sx, 1, 0);
|
|
||||||
|
|
||||||
c->prompt_string = format_expand_time(ft, msg);
|
c->prompt_string = format_expand_time(ft, msg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user