Closed jeromepin closed 4 months ago
Can I see your config? Specifically the window options
Ah yes, my bad, I forgot to add that part...
I tried with both an empty block :
{
'VoxelPrismatic/rabbit.nvim',
version = 'v3.1.*',
config = function()
require("rabbit").setup({})
end
}
Both shown the same issue.
I'm running :Rabbit history
on two already opened buffers.
And :lua =vim.api.nvim_get_current_win()
returns 1000
👍
Can you try the new 3.2.0 update? I'm sure it solves it, unless somehow the width of your window is nil
On ad5f0c5, it still doesn't work with the same error, sorry.
what is returned by this?
:lua vim.print(vim.api.nvim_win_get_config(0))
I get
{
external = false,
focusable = true,
relative = ""
}
So height (or width) isn't set :(
fascinating
For when I get back home: Line 253:
local win_conf = vim.api.nvim_win_get_config(rabbit.user.win)
if win_conf.width == nil or win_conf.height == nil then
win_conf.width = vim.api.nvim_win_get_width(rabbit.user.win)
win_conf.height = vim.api.nvim_win_get_height(rabbit.user.win)
end
So I modified my local copy (on ad5f0c5) of Rabbit with what you typed for yourself :
diff --git i/lua/rabbit/init.lua w/lua/rabbit/init.lua
index eb5d3e9..d6a1245 100644
--- i/lua/rabbit/init.lua
+++ w/lua/rabbit/init.lua
@@ -251,6 +251,10 @@ function rabbit.MakeBuf(mode)
-- Create buffer
local buf = vim.api.nvim_create_buf(false, true)
local win_conf = vim.api.nvim_win_get_config(rabbit.user.win)
+ if win_conf.width == nil or win_conf.height == nil then
+ win_conf.width = vim.api.nvim_win_get_width(rabbit.user.win)
+ win_conf.height = vim.api.nvim_win_get_height(rabbit.user.win)
+ end
rabbit.rabbit.buf = buf
-- Generate configuration
But I get another issue then 😅
The Rabbit popup shows (at the bottom right corner) but says "There's nowhere to jump to! Get started by opening another buffer" while I have two buffers opened :
:buffers
1 #a "cell.py" line 1
2 "~/git/github/lumapps/infra/Makefile" line 0
Then the stacktrace appears :
E5108: Error executing lua: ...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:155: BufLeave Autocommands for "<buffer=4>": Vim(append):Error executing lua callback: ...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:156
: attempt to call field 'nvim_tabpage_set_win' (a nil value)
stack traceback:
...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:156: in function <...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:150>
[C]: in function 'nvim_win_close'
...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:155: in function 'close'
...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:177: in function 'cb'
...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:504: in function <...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:504>
stack traceback:
[C]: in function 'nvim_win_close'
...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:155: in function 'close'
...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:177: in function 'cb'
...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:504: in function <...n/.local/share/nvim/lazy/rabbit.nvim/lua/rabbit/init.lua:504>
Sorry for all the disturbance 😅 I can stop using Rabbit if you prefer 🙇
Line 155:
-- For split windows; returns to expected window
vim.api.nvim_set_current_win(rabbit.user.win)
tabpage_set_win(0, rabbit.user.win) seems to be redundant
Indeed ! It's working properly if I remove the tabpage_set_win
line.
About the There's nowhere to jump to! Get started by opening another buffer
message, it's because while I had multiple buffers opened, I had visited only the first one. Therefore, Rabbit history
didn't have any "visited buffer history" to show.
Thank you very much for your time @VoxelPrismatic 🙏
Hey !
I hoped to try out Rabbit but cannot run it now.
I get the following stack trace because it cannot get a value from https://github.com/VoxelPrismatic/rabbit.nvim/blob/v3.1.4/lua/rabbit/init.lua#L263
I'm on MacOS 14.4.1 with neovim v0.9.4 and Rabbit v3.1.5 (
74c1028
)