mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Fix top/bottom pane calculation with pane border status enabled,
reported by Stanislav Spassov.
This commit is contained in:
21
window.c
21
window.c
@ -541,31 +541,38 @@ window_get_active_at(struct window *w, u_int x, u_int y)
|
||||
struct window_pane *
|
||||
window_find_string(struct window *w, const char *s)
|
||||
{
|
||||
u_int x, y;
|
||||
u_int x, y, top = 0, bottom = w->sy - 1;
|
||||
int status;
|
||||
|
||||
x = w->sx / 2;
|
||||
y = w->sy / 2;
|
||||
|
||||
status = options_get_number(w->options, "pane-border-status");
|
||||
if (status == PANE_STATUS_TOP)
|
||||
top++;
|
||||
else if (status == PANE_STATUS_BOTTOM)
|
||||
bottom--;
|
||||
|
||||
if (strcasecmp(s, "top") == 0)
|
||||
y = 0;
|
||||
y = top;
|
||||
else if (strcasecmp(s, "bottom") == 0)
|
||||
y = w->sy - 1;
|
||||
y = bottom;
|
||||
else if (strcasecmp(s, "left") == 0)
|
||||
x = 0;
|
||||
else if (strcasecmp(s, "right") == 0)
|
||||
x = w->sx - 1;
|
||||
else if (strcasecmp(s, "top-left") == 0) {
|
||||
x = 0;
|
||||
y = 0;
|
||||
y = top;
|
||||
} else if (strcasecmp(s, "top-right") == 0) {
|
||||
x = w->sx - 1;
|
||||
y = 0;
|
||||
y = top;
|
||||
} else if (strcasecmp(s, "bottom-left") == 0) {
|
||||
x = 0;
|
||||
y = w->sy - 1;
|
||||
y = bottom;
|
||||
} else if (strcasecmp(s, "bottom-right") == 0) {
|
||||
x = w->sx - 1;
|
||||
y = w->sy - 1;
|
||||
y = bottom;
|
||||
} else
|
||||
return (NULL);
|
||||
|
||||
|
Reference in New Issue
Block a user