-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Floating nvim-tree does not respect config on startup #2749
Comments
Lazy is problematic and results in issues like these. Please attempt a clean room replication so that we may rule out lazy. |
@stentibbing , I was able to get the floating preview with lazy using this config. Hope it helps
|
Nice one @hoax3 ! Does that work for you @stentibbing ? |
same issue here. |
Hi @alex-courtis ! Sorry for the very late response. I did "clean-room replication" and the same problem still exists. Here's the clean room configuration: `vim.g.loaded_netrw = 1 vim.cmd([[set runtimepath=$VIMRUNTIME]]) -- MODIFY NVIM-TREE SETTINGS THAT ARE NECESSARY FOR REPRODUCING THE ISSUE -- UNCOMMENT this block for diagnostics issues, substituting pattern and cmd as appropriate. |
I tried a few options and |
Thank you, replicated. Behaves as expected:
It seems that *_netrw are not behaving when netrw is not loaded. |
That's working as intended: Same behaviour when not using floating. Please try this: require("nvim-tree").setup({
-- disable_netrw = true,
-- hijack_netrw = true,
hijack_directories = {
enable = false,
},
--- |
I do want the hijack_directories, the option: hijack_directories = {
enable = true,
auto_open = false,
}, does not open the tree on startup but then NvimTreeTroggle still opens this wide tree. It looks like nvim-tree overrides the unnamed buffer to this wide tree instead of the unnamed buffer + the floating window. |
It's actually not an unnamed buffer, it's a buffer with the directory The only purpose of What's your use case / desired functionality here? If you're looking for startup behaviour you need to add that yourself, see wiki: Open At Startup for rationale and recipes. |
Thanks for the explanation, didnt see the wiki. I made a recording to clarify, in this setup up I have these options: hijack_unnamed_buffer_when_opening = true,
-- hijack_netrw = false,
disable_netrw = true, -- disable :Explore
hijack_directories = {
enable = true,
auto_open = false,
}, When opening the tree in a No Name or directory buffer, the options of float are not used: |
This comment was marked as duplicate.
This comment was marked as duplicate.
To clarify: does setting We don't change default behaviour like this as it will break existing users who exect and rely on it. |
Yes when using |
Sorry @jo-pouradier for the late reply, however I'm just not able to replicate this, with absolute or relative paths or You could go with the nuclear option as I do: Edit: see "new window" in the wiki, which wipes before opening: https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup#open-for-directories-and-change-neovims-directory Unless you have some use for directory buffers they should be removed as they just get in the way.
|
Hello! I tried to use new window option, as you mentioned above, but it has no effect and I have similar issue as topic starter — I just get non floating NvimTree_1, which breaks NvimTreeToggle command. Maybe there's some updates on this issue? |
That's no good! Does it throw an exception or just do nothing? Could you please raise a new bug report with a reproducer as it sounds like it might be something a bit different. Hopefully it gets us to the root of this problem. |
Description
When opening a folder with "nvim ." and while having nvim-tree configured to float in a window, nvim-tree opens full screen, not respecting open_win_config. Furthermore, trying to close the initial fullscreen nvim-tree with NvimTreeToggle produces an error:
Error executing Lua callback: ...cal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/view.lua:225: Expected Lua number stack traceback: [C]: in function 'nvim_win_is_valid' ...cal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/view.lua:225: in function 'close' ...cal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/view.lua:235: in function 'close_this_tab_only' ...cal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/view.lua:248: in function 'close' ...lazy/nvim-tree.lua/lua/nvim-tree/actions/tree/toggle.lua:45: in function 'toggle' ...share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/commands.lua:36: in function <...share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/commands.lua:35>
Neovim version
Operating system and version
Windows 11
Windows variant
WSL2 Ubuntu
nvim-tree version
#ddd1d6e, v1.3.0
Clean room replication
Steps to reproduce
Expected behavior
NvimTree should open in a floating window and close on NvimTreeToggle
Actual behavior
NvimTree opens full screen and :NvimTreeToggle produces error
The text was updated successfully, but these errors were encountered: