mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
Aargh. Spaces -> tabs.
This commit is contained in:
parent
4920306486
commit
dd46c95e23
36
status.c
36
status.c
@ -393,13 +393,6 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
|
|||||||
long limit;
|
long limit;
|
||||||
u_int idx;
|
u_int idx;
|
||||||
|
|
||||||
if (s == NULL)
|
|
||||||
s = c->session;
|
|
||||||
if (wl == NULL)
|
|
||||||
wl = s->curw;
|
|
||||||
if (wp == NULL)
|
|
||||||
wp = wl->window->active;
|
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
limit = strtol(*iptr, &endptr, 10);
|
limit = strtol(*iptr, &endptr, 10);
|
||||||
if ((limit == 0 && errno != EINVAL) ||
|
if ((limit == 0 && errno != EINVAL) ||
|
||||||
@ -444,8 +437,7 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
|
|||||||
case 'P':
|
case 'P':
|
||||||
if (window_pane_index(wp, &idx) != 0)
|
if (window_pane_index(wp, &idx) != 0)
|
||||||
fatalx("index not found");
|
fatalx("index not found");
|
||||||
xsnprintf(
|
xsnprintf(tmp, sizeof tmp, "%u", idx);
|
||||||
tmp, sizeof tmp, "%u", idx);
|
|
||||||
ptr = tmp;
|
ptr = tmp;
|
||||||
goto do_replace;
|
goto do_replace;
|
||||||
case 'S':
|
case 'S':
|
||||||
@ -468,6 +460,9 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
|
|||||||
*/
|
*/
|
||||||
ch = ']';
|
ch = ']';
|
||||||
goto skip_to;
|
goto skip_to;
|
||||||
|
case '{':
|
||||||
|
ptr = (char *) "#{";
|
||||||
|
goto do_replace;
|
||||||
case '#':
|
case '#':
|
||||||
*(*optr)++ = '#';
|
*(*optr)++ = '#';
|
||||||
break;
|
break;
|
||||||
@ -507,13 +502,21 @@ char *
|
|||||||
status_replace(struct client *c, struct session *s, struct winlink *wl,
|
status_replace(struct client *c, struct session *s, struct winlink *wl,
|
||||||
struct window_pane *wp, const char *fmt, time_t t, int jobsflag)
|
struct window_pane *wp, const char *fmt, time_t t, int jobsflag)
|
||||||
{
|
{
|
||||||
static char out[BUFSIZ];
|
static char out[BUFSIZ];
|
||||||
char in[BUFSIZ], ch, *iptr, *optr;
|
char in[BUFSIZ], ch, *iptr, *optr, *expanded;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
struct format_tree *ft;
|
||||||
|
|
||||||
if (fmt == NULL)
|
if (fmt == NULL)
|
||||||
return (xstrdup(""));
|
return (xstrdup(""));
|
||||||
|
|
||||||
|
if (s == NULL)
|
||||||
|
s = c->session;
|
||||||
|
if (wl == NULL)
|
||||||
|
wl = s->curw;
|
||||||
|
if (wp == NULL)
|
||||||
|
wp = wl->window->active;
|
||||||
|
|
||||||
len = strftime(in, sizeof in, fmt, localtime(&t));
|
len = strftime(in, sizeof in, fmt, localtime(&t));
|
||||||
in[len] = '\0';
|
in[len] = '\0';
|
||||||
|
|
||||||
@ -534,7 +537,14 @@ status_replace(struct client *c, struct session *s, struct winlink *wl,
|
|||||||
}
|
}
|
||||||
*optr = '\0';
|
*optr = '\0';
|
||||||
|
|
||||||
return (xstrdup(out));
|
ft = format_create();
|
||||||
|
format_client(ft, c);
|
||||||
|
format_session(ft, s);
|
||||||
|
format_winlink(ft, s, wl);
|
||||||
|
format_window_pane(ft, wp);
|
||||||
|
expanded = format_expand(ft, out);
|
||||||
|
format_free(ft);
|
||||||
|
return (expanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out job name and get its result, starting it off if necessary. */
|
/* Figure out job name and get its result, starting it off if necessary. */
|
||||||
|
Loading…
Reference in New Issue
Block a user