diff options
author | sabetts <sabetts> | 2001-03-12 01:10:48 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-03-12 01:10:48 +0000 |
commit | 63e226ae9eec6ca3cdaa5bfdc530d51121594a93 (patch) | |
tree | 8eacee028d2f7ae5143440c41e7cfcc3d239c247 /src/actions.c | |
parent | 0f1f9aa36796a34d01fb101c5ff5f0875104689e (diff) | |
download | ratpoison-63e226ae9eec6ca3cdaa5bfdc530d51121594a93.zip |
merged rel-0-1-0 branch
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/actions.c b/src/actions.c index e4480da..debc821 100644 --- a/src/actions.c +++ b/src/actions.c @@ -410,23 +410,30 @@ cmd_select (void *data) else str = strdup ((char *) data); - /* try by number */ - if ((n = string_to_window_number (str)) >= 0) - { - if ((w = find_window_number (n))) - set_active_window (w); - else - /* show the window list as feedback */ - show_bar (current_screen ()); - } - else - /* try by name */ + /* Only search if the string contains something to search for. */ + if (strlen (str) > 0) { if ((w = find_window_name (str))) set_active_window (w); + + /* try by number */ + if ((n = string_to_window_number (str)) >= 0) + { + if ((w = find_window_number (n))) + set_active_window (w); + else + /* show the window list as feedback */ + show_bar (current_screen ()); + } else - /* we need to format a string that includes the str */ - message (" no window by that name "); + /* try by name */ + { + if ((w = find_window_name (str))) + set_active_window (w); + else + /* we need to format a string that includes the str */ + message (" no window by that name "); + } } free (str); |