From 9601b72e4ced58d08f4c1351865746b46ab5895e Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 15 Jul 2009 08:00:49 +0000 Subject: 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. --- window.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'window.c') diff --git a/window.c b/window.c index 46a713df..7823d2f5 100644 --- a/window.c +++ b/window.c @@ -81,6 +81,19 @@ winlink_cmp(struct winlink *wl1, struct winlink *wl2) return (wl1->idx - wl2->idx); } +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) { -- cgit