windows.nvim icon indicating copy to clipboard operation
windows.nvim copied to clipboard

Odd issue with Neovim Spectre

Open LandonSchropp opened this issue 3 years ago • 3 comments
trafficstars

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?

LandonSchropp avatar Sep 21 '22 19:09 LandonSchropp

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 avatar Sep 22 '22 09:09 ten3roberts

Are you still experiencing the issue?

ten3roberts avatar Oct 17 '22 07:10 ten3roberts

@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.

LandonSchropp avatar Nov 10 '22 19:11 LandonSchropp