This commit is contained in:
2025-08-04 23:27:07 +02:00
parent ecaf50a044
commit 3929be281b
5 changed files with 52 additions and 6 deletions

View File

@@ -9,16 +9,19 @@ function M.smart_open()
if is_real_file then
target_path = vim.fn.fnamemodify(bufname, ":p:h")
vim.cmd("Neotree toggle position=left reveal_file=" .. target_path)
elseif bufname ~= "" then
-- buffer avec un nom mais fichier inexistant (ex: nouveau buffer)
target_path = "~"
elseif vim.bo.filetype == "starter" then
vim.cmd("Neotree toggle position=right reveal_force_cwd reveal_file=" .. target_path)
elseif vim.bo.filetype == "ministarter" then
-- buffer mini.starter
target_path = "~"
vim.cmd("Neotree toggle reveal=true position=float dir=" .. target_path)
end
-- Appel de Neotree avec le bon dossier
vim.cmd("Neotree toggle reveal=true position=float dir=" .. target_path)
-- vim.cmd("Neotree toggle reveal=true dir=" .. target_path)
end
return M