anuvyklack / windows.nvim

Automatically expand width of the current window. Maximizes and restore it. And all this with nice animations!
MIT License
537 stars 15 forks source link

Odd issue with Neovim Spectre #13

Open LandonSchropp opened 2 years ago

LandonSchropp commented 2 years ago

I'm using the nvim-spectre plugin and running into some incredibly odd issues with windows.nvim. I don't know quite how to describe it, so it might be easier just to show a quick video.

https://user-images.githubusercontent.com/361591/191592657-b230aa36-38e7-4c1e-985c-1f00ba1ff668.mov

The only way I've found to make this issue go away is to type Ctrl-C, after which Spectre exits insert mode and I'm able to use it again.

This is the keybinding I'm using to open Spectre:

lvim.builtin.which_key.mappings["F"] = {
  function()
    require("spectre").open({
      is_open_target_win = false,
      is_insert_mode = true,
    })
  end,
  "Find Text",
}

And here's how I have windows.nvim included:

  {
    "anuvyklack/windows.nvim",
    requires = {
      "anuvyklack/middleclass",
      "anuvyklack/animation.nvim",
    },
    config = function()
      vim.o.winwidth = 10
      vim.o.winminwidth = 10
      vim.o.equalalways = false
      require("windows").setup()
    end,
  },

I'm not quite sure where to begin debugging this. Do you have any thoughts/suggestions about what might be causing this issue?

ten3roberts commented 2 years ago

I have also encountered this issue when switching to terminal buffer, which gets into the same weird state and prevents me from exiting the window.

I think it is caused by the nvim_set_current_win, which is used by plugins such as spectre or neogit (same issue in the commit popup) to shift focus to the window while in the middle of a function.

I am not sure if the command emits an autocmd

ten3roberts commented 2 years ago

Are you still experiencing the issue?

LandonSchropp commented 1 year ago

@ten3roberts Sorry, just saw this notification. For the time being, I disabled windows.nvim so I wouldn't need to worry about it.

I'll double-check to see if this is still an issue.