-
-
Notifications
You must be signed in to change notification settings - Fork 597
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
New File getting opened in floating window. #2743
Comments
Reproduced. Removed this and the issue goes away: -- This will make sure that newly created file get's open to edit
api.events.subscribe(api.events.Event.FileCreated, function(file)
vim.cmd("edit " .. file.fname)
end) What's the purpose of that event? |
It resolves the issue kindda. Is there any way i can check if NvimTree is in floating mode or not? |
It will float depending on your Perhaps you are after |
or perhaps |
Thanks for the help @alex-courtis. After seeing the help options you mentioned, I came up with the snippet below That closes NvimTree if new file is created. -- This will make sure that newly created file get's open to edit
api.events.subscribe(api.events.Event.FileCreated, function(file)
local win_id = api.tree.winid()
if win_id ~= nil then
vim.cmd([[NvimTreeClose]])
end
vim.cmd("edit " .. file.fname)
end)
|
Description
As it has been getting discussed, #2739 (reply in thread)
Creation of any new file opens the buffer into the nvim floating window.
#2739 (reply in thread)
Neovim version
Operating system and version
Arch Linux 6.8.4-zen1-1-zen
Windows variant
No response
nvim-tree version
81eb8d5
Clean room replication
Steps to reproduce
a
then type yourfilename
Expected behavior
The floating window should be closed and the buffer of the newly created file should be focused.
Actual behavior
output.mp4
The text was updated successfully, but these errors were encountered: