If we want the flag to only be 1 if the window is linked across
sessions, not if it is linked twice into a single session, you will also
need to clear the flag when a window is joined or moved from session B
into a session A where it already exists (assuming it is not already
linked into another session C).
Wouldn't something like this work and be a lot easier?
s = TAILQ_FIRST(&w->winlinks)->session;
TAILQ_FOREACH(wl, &w->winlinks, wentry) {
if (wl->session != s)
return (1);
}
return (0);
On Sat, Jan 07, 2017 at 03:39:07PM +0000, Thomas Adam wrote:
> On Sat, Jan 07, 2017 at 03:18:24PM +0000, Nicholas Marriott wrote:
> > server_unlink_window should only remove the flag when there are no
> > remaining links, so it should only remove the flag if
> > TAILQ_NEXT(TAILQ_FIRST(&wl->window->winlinks)) == NULL.
> >
> > > +
> > > + TAILQ_FOREACH(wl1, &wl->window->winlinks, wentry)
> > > + wl1->window->flags &= ~WINDOW_LINKED;
> >
> > All the winlinks will point to the same window so you don't need to
> > clear the flags on each.
>
> Hmm. Without this, it seems the srcwl which was used as the link window is
> never cleared -- that is to say, when issuing a 'unlinkw' command, the
> original window is still marked as being linked.
>
> I'll look into why.
>
> Thomas
--
You received this message because you are subscribed to the Google Groups
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.