summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-07-15 08:00:49 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-07-15 08:00:49 +0000
commit9601b72e4ced58d08f4c1351865746b46ab5895e (patch)
treede17b881631bbc366a20e6e27e1a62ec041f7602 /window.c
parentca617d679ff296a4abe0e7526d8e8cab4f87e338 (diff)
The man page says that kill-window removes the window entirely, unlinking it
from any sessions. In fact the implementation only affected the current session, making it the same as unlink-window but destroying the window if it was linked into only one session (unlinkw gives an error). Change the behaviour to match what it documented and was originally intended.
Diffstat (limited to 'window.c')
-rw-r--r--window.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/window.c b/window.c
index 46a713df..7823d2f5 100644
--- a/window.c
+++ b/window.c
@@ -82,6 +82,19 @@ winlink_cmp(struct winlink *wl1, struct winlink *wl2)
}
struct winlink *
+winlink_find_by_window(struct winlinks *wwl, struct window *w)
+{
+ struct winlink *wl;
+
+ RB_FOREACH(wl, winlinks, wwl) {
+ if (wl->window == w)
+ return (wl);
+ }
+
+ return (NULL);
+}
+
+struct winlink *
winlink_find_by_index(struct winlinks *wwl, int idx)
{
struct winlink wl;