rasulomaroff / reactive.nvim

Reactivity. Right in your neovim.
Apache License 2.0
183 stars 1 forks source link

Reactive + Octo causes preview windows to not display data #12

Closed milogert closed 5 months ago

milogert commented 5 months ago

Using reactive.nvim and octo.nvim together causes the preview windows on hover to show no data as seen in the screenshot below.

Screenshot 2024-03-20 at 6 03 14 PM

Removing reactive.nvim causes the problem to go away and data is seen in the hover window. You can trigger the hover window by putting your cursor over a reference in octo.nvim, like I have in the screenshot (my cursor is over the # in #1 which is an issue reference).

rasulomaroff commented 5 months ago

Hi @milogert

I was able to reproduce this without using reactive:

  1. disable reactive completely

  2. paste this autocmd somewhere in your config (it should be active when you enter neovim)

    vim.api.nvim_create_autocmd('BufWinEnter', {
    callback = function()
    vim.cmd.redraw()
    end,
    })
  3. try to reproduce the issue you described

reactive uses BufWinEnter autocmd together with redraw to always show a real current state for windows/buffers and highlights that are applied to them. As well as WinEnter and WinLeave autocmds. That said, this can be either a Neovim bug, or a Octo bug. I checked their (octo) source code and it seems like they open a popup using method create_popup located in lua/octo/ui/window.lua file, in case you wanna reference it there as well. I'm not really familiar with the codebase, but it seems like there're no errors in their code, but that's my opinion just looking at it really quickly so I'm not sure.

The error is happening only when using redraw command, so this can be a Neovim bug as well. I already faced really weird behaviour that is similar to this one, you can check #7 for that. Still haven't found time to create an issue in the Neovim's repo.

rasulomaroff commented 5 months ago

closing this as not related feel free to open other issues when having troubles