carbon-steel / detour.nvim

Use popup windows to navigate files/buffer and to contain shells/TUIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Closing detour popup closes parent window if any nested popups were spawned.

neilvyas opened this issue · comments

repro (verified on dev):

expected behavior:

  1. issue :Detour.
  2. close popup.
  3. parent window remains.

buggy behavior:

  1. issue :Detour. (say, "child 1")
  2. issue :Detour again, creating a nested popup. (say, "child 2")
  3. issue :q; observe child 2 is closed.
  4. issue :q; observe child 1 AND parent are closed.

haven't debugged this one, but I noticed it working on #22

my suspicion is that nested popups and regular popups should not really have much separate logic, and it is that they currently have separated logic whcih is resulting in these bugs, but I don't understand the new "covered window" stuff in the dev branch to attempt unification of the two branches.

I believe you're seeing this.

I do plan on changing the plugin to prevent windows with popups over them from being focused on, but it's a bit of an involved change so it'll take time.

that's correct; I think #8 matches what I think. Naively, I would expect the popups to form a stack, where focus follows the top element of the stack. I appreciate that this could result in weird interactions with plugins, and secondly that nesting multiple detour popups is probably neither likely nor truly intended.

actually resolved by #8