Closed David-Kunz closed 4 weeks ago
Thanks for the suggestion!
This works as expected because open()
is called not with existing on disk path. To open explorer in current directory, use either one of:
MiniFiles.open()
.MiniFiles.open(vim.fn.getcwd())
._G.open_smart = function()
local buf_name = vim.api.nvim_buf_get_name(0)
local path = vim.fn.filereadable(buf_name) == 1 and buf_name or vim.fn.getcwd()
add_to_log(path)
MiniFiles.open(path)
end
Thank you, @echasnovski !
Contributing guidelines
Module(s)
mini.files
Description
When opening
mini.files
with a terminal buffer, one gets the following error message:Suggestion: Open the current working directory instead (
vim.fn.getcwd()
).Thanks, @echasnovski !
Neovim version
0.10.1
Steps to reproduce
:term
:lua MiniFiles.open(vim.api.nvim_buf_get_name(0))
Expected behavior
Opens
vim.fn.getcwd()
instead.Actual behavior
Throws error