Add a client redraw-window flag instead of the redraw-all flag and for

all just use the three flags together (window, borders, status).
This commit is contained in:
nicm
2018-08-19 16:45:03 +00:00
parent bd2896b65e
commit 88327c7698
6 changed files with 65 additions and 77 deletions

View File

@ -157,7 +157,7 @@ status_timer_callback(__unused int fd, __unused short events, void *arg)
return;
if (c->message_string == NULL && c->prompt_string == NULL)
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
timerclear(&tv);
tv.tv_sec = options_get_number(s->options, "status-interval");
@ -615,7 +615,7 @@ status_message_set(struct client *c, const char *fmt, ...)
}
c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE);
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
}
/* Clear status line message. */
@ -630,7 +630,7 @@ status_message_clear(struct client *c)
if (c->prompt_string == NULL)
c->tty.flags &= ~(TTY_NOCURSOR|TTY_FREEZE);
c->flags |= CLIENT_REDRAW; /* screen was frozen and may have changed */
c->flags |= CLIENT_ALLREDRAWFLAGS; /* was frozen and may have changed */
screen_reinit(&c->status.status);
}
@ -734,7 +734,7 @@ status_prompt_set(struct client *c, const char *msg, const char *input,
if (~flags & PROMPT_INCREMENTAL)
c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE);
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
if ((flags & PROMPT_INCREMENTAL) && *tmp != '\0') {
xasprintf(&cp, "=%s", tmp);
@ -763,7 +763,7 @@ status_prompt_clear(struct client *c)
c->prompt_buffer = NULL;
c->tty.flags &= ~(TTY_NOCURSOR|TTY_FREEZE);
c->flags |= CLIENT_REDRAW; /* screen was frozen and may have changed */
c->flags |= CLIENT_ALLREDRAWFLAGS; /* was frozen and may have changed */
screen_reinit(&c->status.status);
}
@ -791,7 +791,7 @@ status_prompt_update(struct client *c, const char *msg, const char *input)
c->prompt_hindex = 0;
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
free(tmp);
format_free(ft);
@ -938,7 +938,7 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
return (1);
case '\033': /* Escape */
c->prompt_mode = PROMPT_COMMAND;
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
return (0);
}
*new_key = key;
@ -952,17 +952,17 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
case 's':
case 'a':
c->prompt_mode = PROMPT_ENTRY;
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
break; /* switch mode and... */
case 'S':
c->prompt_mode = PROMPT_ENTRY;
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
*new_key = '\025'; /* C-u */
return (1);
case 'i':
case '\033': /* Escape */
c->prompt_mode = PROMPT_ENTRY;
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
return (0);
}
@ -1357,7 +1357,7 @@ process_key:
goto append_key;
}
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
return (0);
append_key:
@ -1392,7 +1392,7 @@ append_key:
}
changed:
c->flags |= CLIENT_STATUS;
c->flags |= CLIENT_REDRAWSTATUS;
if (c->prompt_flags & PROMPT_INCREMENTAL) {
s = utf8_tocstr(c->prompt_buffer);
xasprintf(&cp, "%c%s", prefix, s);