From 02b004540a364b6aec9332f60c9470df10fc3a2a Mon Sep 17 00:00:00 2001 From: sabetts Date: Wed, 15 Mar 2006 07:10:40 +0000 Subject: * src/bar.c (show_bar): accept a fmt argument. all callers and prototype updated. (update_bar): just display the last message if bar isn't hidden. (update_window_names): accept a fmt argument. all callers and prototype updated. * src/actions.c (init_user_commands): add optional argument to "info" (cmd_info): handle optional argument (cmd_windows): when called interactively use the argument as the format string. --- src/actions.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index b756c41..d9cc00e 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1273,7 +1273,7 @@ cmd_select (int interactive, struct cmdarg **args) goto_window (elem->win); else /* show the window list as feedback */ - show_bar (current_screen ()); + show_bar (current_screen (), defaults.window_fmt); } else /* try by name */ @@ -1306,7 +1306,7 @@ cmd_rename (int interactive, struct cmdarg **args) current_window()->named = 1; /* Update the program bar. */ - update_window_names (current_screen()); + update_window_names (current_screen(), defaults.window_fmt); return cmdret_new (RET_SUCCESS, NULL); } @@ -2588,7 +2588,7 @@ cmd_number (int interactive, struct cmdarg **args) group_resort_window (rp_current_group, win); /* Update the window list. */ - update_window_names (win->win->scr); + update_window_names (win->win->scr, defaults.window_fmt); } return cmdret_new (RET_SUCCESS, NULL); @@ -2602,6 +2602,12 @@ cmd_windows (int interactive, struct cmdarg **args) char *tmp; int dummy; rp_screen *s; + char *fmt; + + if (args[0] == NULL) + fmt = defaults.window_fmt; + else + fmt = ARG_STRING(0); if (interactive) { @@ -2612,17 +2618,14 @@ cmd_windows (int interactive, struct cmdarg **args) off. OR the timeout is >0 then show the bar. Which means, always show the bar if msgwait is >0 which fixes the case when a command in the prefix hook displays the bar. */ - if (!hide_bar (s) || defaults.bar_timeout > 0) show_bar (s); + if (!hide_bar (s) || defaults.bar_timeout > 0) show_bar (s, fmt); return cmdret_new (RET_SUCCESS, NULL); } else { window_list = sbuf_new (0); - if (args[0]) - get_window_list (ARG_STRING(0), "\n", window_list, &dummy, &dummy); - else - get_window_list (defaults.window_fmt, "\n", window_list, &dummy, &dummy); + get_window_list (fmt, "\n", window_list, &dummy, &dummy); tmp = sbuf_get (window_list); free (window_list); -- cgit v1.2.3