From b6d1a9b5096e8e26acbe392ca44216d8573427e4 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sun, 25 May 2003 09:14:49 +0000 Subject: * src/bar.c (reset_alarm): new function (show_bar): call reset_alarm() (count_lines): make function static. clean up code. (max_line_length): likewise (pos_in_line): likewise (line_beginning): likewise (draw_string): new static function (correct_mark): likewise (prepare_bar): likewise (get_mark_box): likewise (draw_inverse_box): likewise (draw_mark): likewise (update_last_message): likewise (marked_message): Move most of the code to seperate function calls. Call reset_alarm(), prepare_bar(), draw_string(), correct_mark(), draw_mark(), and update_last_message(). * src/actions.c (cmd_select): fix crash bug. * src/window.c (get_window_list): mark_end is the length of the string. Don't do a special case if the window list is being displayed as a column. --- src/actions.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index ca12c4e..c92fabd 100644 --- a/src/actions.c +++ b/src/actions.c @@ -756,7 +756,6 @@ cmd_select (int interactive, char *data) { char *str; int n; - rp_window *w; if (data == NULL) str = get_input (MESSAGE_PROMPT_SWITCH_TO_WINDOW); @@ -774,17 +773,13 @@ cmd_select (int interactive, char *data) { blank_frame (current_frame()); } -/* else if ((w = find_window_name (str))) */ -/* { */ -/* goto_window (w); */ -/* } */ /* try by number */ else if ((n = string_to_window_number (str)) >= 0) { rp_window_elem *elem = group_find_window_by_number (rp_current_group, n); - if ((w = elem->win)) - goto_window (w); + if (elem) + goto_window (elem->win); else /* show the window list as feedback */ show_bar (current_screen ()); @@ -792,8 +787,10 @@ cmd_select (int interactive, char *data) else /* try by name */ { - if ((w = find_window_name (str))) - goto_window (w); + rp_window *win = find_window_name (str); + + if (win) + goto_window (win); else marked_message_printf (0, 0, " select: unknown window '%s' ", str); } -- cgit v1.2.3