From d306bbe11e9701235a468e463699a832b89d6f4d Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 2 Oct 2014 10:39:43 +0000 Subject: Take account of window-status-separator when checking window position, based on diff from Balazs Kezes. --- status.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'status.c') diff --git a/status.c b/status.c index 4ea42f1c..96110c77 100644 --- a/status.c +++ b/status.c @@ -121,12 +121,17 @@ status_set_window_at(struct client *c, u_int x) { struct session *s = c->session; struct winlink *wl; + struct options *oo; + size_t len; x += c->wlmouse; RB_FOREACH(wl, winlinks, &s->windows) { + oo = &wl->window->options; + + len = strlen(options_get_string(oo, "window-status-separator")); if (x < wl->status_width && session_select(s, wl->idx) == 0) server_redraw_session(s); - x -= wl->status_width + 1; + x -= wl->status_width + len; } } -- cgit From a27ba6e38006c12c48de88600b8cff9f6aabfed7 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 8 Oct 2014 17:35:58 +0000 Subject: Add xreallocarray and remove nmemb argument from xrealloc. --- status.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'status.c') diff --git a/status.c b/status.c index 96110c77..70e0551b 100644 --- a/status.c +++ b/status.c @@ -992,7 +992,7 @@ status_prompt_key(struct client *c, int key) /* Insert the new word. */ size += strlen(s); off = first - c->prompt_buffer; - c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 1); + c->prompt_buffer = xrealloc(c->prompt_buffer, size + 1); first = c->prompt_buffer + off; memmove(first + strlen(s), first, n); memcpy(first, s, strlen(s)); @@ -1170,7 +1170,7 @@ status_prompt_key(struct client *c, int key) break; } - c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + n + 1); + c->prompt_buffer = xrealloc(c->prompt_buffer, size + n + 1); if (c->prompt_index == size) { memcpy(c->prompt_buffer + c->prompt_index, pb->data, n); c->prompt_index += n; @@ -1210,7 +1210,7 @@ status_prompt_key(struct client *c, int key) case MODEKEY_OTHER: if ((key & 0xff00) != 0 || key < 32 || key == 127) break; - c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 2); + c->prompt_buffer = xrealloc(c->prompt_buffer, size + 2); if (c->prompt_index == size) { c->prompt_buffer[c->prompt_index++] = key; -- cgit From 0a1a88d63caf3a0e8b4440686e73e1f0f690e03c Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 20 Oct 2014 23:57:13 +0000 Subject: Better format for printf format attributes. --- status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'status.c') diff --git a/status.c b/status.c index 70e0551b..287039ed 100644 --- a/status.c +++ b/status.c @@ -651,7 +651,7 @@ status_print( } /* Set a status line message. */ -void printflike2 +void status_message_set(struct client *c, const char *fmt, ...) { struct timeval tv; -- cgit