diff --git a/lua/plugins/custom/filetree.lua b/lua/plugins/custom/filetree.lua index 783d3eb..7b639cb 100644 --- a/lua/plugins/custom/filetree.lua +++ b/lua/plugins/custom/filetree.lua @@ -126,7 +126,6 @@ return { end -- Reuse empty buffer in current tab local wins = vim.api.nvim_tabpage_list_wins(0) - local empty_buf = nil for _, win in ipairs(wins) do if vim.api.nvim_win_is_valid(win) then local buf = vim.api.nvim_win_get_buf(win) @@ -165,11 +164,8 @@ return { end end end - if empty_buf then - vim.cmd('edit ' .. vim.fn.fnameescape(path)) - else - vim.cmd('tabnew ' .. vim.fn.fnameescape(path)) - end + -- No reusable window found, open in a new tab + vim.cmd('tabnew ' .. vim.fn.fnameescape(path)) -- Always close Neo-tree window if open for _, win in ipairs(vim.api.nvim_list_wins()) do if vim.api.nvim_win_is_valid(win) then diff --git a/lua/plugins/custom/telescope.lua b/lua/plugins/custom/telescope.lua index 1e95602..e803898 100644 --- a/lua/plugins/custom/telescope.lua +++ b/lua/plugins/custom/telescope.lua @@ -311,19 +311,8 @@ return { require('telescope.builtin').git_files { attach_mappings = function(_, map) map('n', 'q', actions.close) - local actions = require 'telescope.actions' - local action_state = require 'telescope.actions.state' - - local function open_smart(prompt_bufnr) - local entry = action_state.get_selected_entry() - if not entry then - return - end - pcall(actions.close, prompt_bufnr) - smart_open(prompt_bufnr) - end - map('i', '', open_smart) - map('n', '', open_smart) + map('i', '', smart_open) + map('n', '', smart_open) return true end, }