On 2014-08-08 13:23 +0100, Thomas Adam wrote:
> Use size_t rather than int for the strlen() call, please.

Ah, of course. Fixed.

-- 
Balazs
>From c25af71569e4e14f84c498b5980559e4ae9c801a Mon Sep 17 00:00:00 2001
From: Balazs Kezes <balke...@google.com>
Date: Fri, 8 Aug 2014 05:06:35 -0700
Subject: [PATCH] Fix mouse window switching in the status bar

Currently it is broken when the window-status-separator is anything other than a
single character.
---
 status.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/status.c b/status.c
index deb1b60..e094f13 100644
--- a/status.c
+++ b/status.c
@@ -121,12 +121,15 @@ status_set_window_at(struct client *c, u_int x)
 {
 	struct session	*s = c->session;
 	struct winlink	*wl;
+	size_t		 sep_length;
 
 	x += c->wlmouse;
 	RB_FOREACH(wl, winlinks, &s->windows) {
 		if (x < wl->status_width && session_select(s, wl->idx) == 0)
 			server_redraw_session(s);
-		x -= wl->status_width + 1;
+		sep_length = strlen(options_get_string(
+		    &wl->window->options, "window-status-separator"));
+		x -= wl->status_width + sep_length;
 	}
 }
 
-- 
2.0.0.526.g5318336

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to