mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Fix /window goto to reach all the items with the same name when there
are more than two. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4595 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
402fa7ad94
commit
39d42bdad4
@ -279,6 +279,17 @@ static WINDOW_REC *window_highest_activity(WINDOW_REC *window)
|
||||
return max_win;
|
||||
}
|
||||
|
||||
static inline int is_nearer(int r1, int r2)
|
||||
{
|
||||
int a = r2 < active_win->refnum;
|
||||
int b = r1 < r2;
|
||||
|
||||
if (r1 > active_win->refnum)
|
||||
return a || b;
|
||||
else
|
||||
return a && b;
|
||||
}
|
||||
|
||||
static WINDOW_REC *window_find_item_cycle(SERVER_REC *server, const char *name)
|
||||
{
|
||||
WINDOW_REC *rec, *win;
|
||||
@ -297,9 +308,10 @@ static WINDOW_REC *window_find_item_cycle(SERVER_REC *server, const char *name)
|
||||
|
||||
rec = tmp->data;
|
||||
|
||||
if (window_item_find_window(rec, server, name) != NULL) {
|
||||
if (window_item_find_window(rec, server, name) != NULL &&
|
||||
(win == NULL || is_nearer(rec->refnum, win->refnum))) {
|
||||
win = rec;
|
||||
break;
|
||||
if (server != NULL) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user