From 29e36a8fb0ff74a666dd49b605a9ae62d869ba41 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 31 Mar 2011 02:44:33 +0200 Subject: [PATCH 1/2] Make window left/right skip windows that are already visible in other mainwins --- src/fe-text/mainwindows.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 711daf0a..be2cb100 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -1642,7 +1642,8 @@ static int window_refnum_left(int refnum, int wrap) break; window = window_find_refnum(refnum); - } while (!WINDOW_STICKY_MATCH(window, find_sticky)); + } while (!WINDOW_STICKY_MATCH(window, find_sticky) || + is_window_visible(window)); return refnum; } @@ -1664,7 +1665,8 @@ static int window_refnum_right(int refnum, int wrap) break; window = window_find_refnum(refnum); - } while (!WINDOW_STICKY_MATCH(window, find_sticky)); + } while (!WINDOW_STICKY_MATCH(window, find_sticky) || + is_window_visible(window)); return refnum; } From 7b22f41ec50d1bd9fa8e1cf71ee0a6ce8da54533 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Wed, 19 Jan 2022 20:49:56 +0100 Subject: [PATCH 2/2] formatting --- src/fe-text/mainwindows.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index be2cb100..fae7ced8 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -1642,10 +1642,9 @@ static int window_refnum_left(int refnum, int wrap) break; window = window_find_refnum(refnum); - } while (!WINDOW_STICKY_MATCH(window, find_sticky) || - is_window_visible(window)); + } while (!WINDOW_STICKY_MATCH(window, find_sticky) || is_window_visible(window)); - return refnum; + return refnum; } static int window_refnum_right(int refnum, int wrap) @@ -1665,10 +1664,9 @@ static int window_refnum_right(int refnum, int wrap) break; window = window_find_refnum(refnum); - } while (!WINDOW_STICKY_MATCH(window, find_sticky) || - is_window_visible(window)); + } while (!WINDOW_STICKY_MATCH(window, find_sticky) || is_window_visible(window)); - return refnum; + return refnum; } /* SYNTAX: WINDOW LEFT [-directional] */