mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
Calculate offset correctly, fixes incorrect offset and prevents crash when
status-left is empty. From Micah Cowan.
This commit is contained in:
parent
3e2cc2d2c4
commit
05213e4c8c
10
status.c
10
status.c
@ -302,18 +302,20 @@ draw:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out the offset for the window list. */
|
/* Figure out the offset for the window list. */
|
||||||
wloffset = 1;
|
if (llen != 0)
|
||||||
|
wloffset = llen + 1;
|
||||||
|
else
|
||||||
|
wloffset = 0;
|
||||||
if (wlwidth < wlavailable) {
|
if (wlwidth < wlavailable) {
|
||||||
switch (options_get_number(&s->options, "status-justify")) {
|
switch (options_get_number(&s->options, "status-justify")) {
|
||||||
case 1: /* centered */
|
case 1: /* centered */
|
||||||
wloffset = 1 + (wlavailable - wlwidth) / 2;
|
wloffset += (wlavailable - wlwidth) / 2;
|
||||||
break;
|
break;
|
||||||
case 2: /* right */
|
case 2: /* right */
|
||||||
wloffset = 1 + (wlavailable - wlwidth);
|
wloffset += (wlavailable - wlwidth);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wloffset += llen;
|
|
||||||
if (larrow != 0)
|
if (larrow != 0)
|
||||||
wloffset++;
|
wloffset++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user