From 8bfbc8c61d14369a023444f49a4708e551cb7342 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 15 Jul 2009 17:45:09 +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 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'window.c') diff --git a/window.c b/window.c index 3823158a..e290d8be 100644 --- a/window.c +++ b/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.92 2009-07-15 17:43:21 nicm Exp $ */ +/* $Id: window.c,v 1.93 2009-07-15 17:45:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -79,6 +79,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