diff options
| -rw-r--r-- | mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua | 2 | ||||
| -rw-r--r-- | mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lf.lua | 2 | ||||
| -rw-r--r-- | mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua | 46 |
3 files changed, 34 insertions, 16 deletions
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua index a8872cb..fdecb52 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua @@ -45,7 +45,7 @@ return { "nvim-telescope/telescope.nvim", -- for file_selector provider telescope "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions "ibhagwan/fzf-lua", -- for file_selector provider fzf - -- "stevearc/dressing.nvim", -- for input provider dressing -> conflict with urlview.nvim + -- "stevearc/dressing.nvim", -- for input provider dressing "folke/snacks.nvim", -- for input provider snacks "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons "zbirenbaum/copilot.lua", -- for providers='copilot' diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lf.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lf.lua index 3f82222..63275f0 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lf.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lf.lua @@ -81,7 +81,7 @@ return { escape_quit = true, -- Map escape to the quit command focus_on_open = true, -- Focus the current file when opening Lf mappings = true, -- Enable terminal buffer mapping - tmux = true, -- Tmux statusline can be disabled + tmux = false, -- Tmux statusline can be disabled disable_netrw_warning = true, -- Don't display a message when opening a directory highlights = { Normal = { link = "Normal" }, -- Use normal highlighting diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua index b7d87c6..c640af0 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua @@ -33,26 +33,44 @@ end local function telescope_open_single_or_multi(bufnr) local actions = require("telescope.actions") - local actions_state = require("telescope.actions.state") + local action_state = require("telescope.actions.state") - local picker = actions_state.get_current_picker(bufnr) - local multi_selection = picker:get_multi_selection() + local picker = action_state.get_current_picker(bufnr) + local multi = picker:get_multi_selection() - if not vim.tbl_isempty(multi_selection) then - actions.close(bufnr) - for _, entry in ipairs(multi_selection) do - if entry.path then - vim.cmd(string.format("edit %s", entry.path)) + local function open_path(p) + vim.cmd("edit " .. vim.fn.fnameescape(p)) + end + + -- If there are multiple selections and at least one has a path, open those. + if multi and #multi > 0 then + local opened_any = false + for _, entry in ipairs(multi) do + if entry and entry.path then + if not opened_any then + actions.close(bufnr) + end + opened_any = true + open_path(entry.path) end end - else - -- Only open the file under the cursor if nothing is selected - local entry = actions_state.get_selected_entry() - if entry and entry.path then - actions.close(bufnr) - vim.cmd(string.format("edit %s", entry.path)) + if opened_any then + return + else + -- Nothing had a path → fall back (e.g. ui-select) + return actions.select_default(bufnr) end end + + -- Single selection + local entry = action_state.get_selected_entry() + if entry and entry.path then + actions.close(bufnr) + open_path(entry.path) + else + -- No path → let Telescope / ui-select handle Enter normally + return actions.select_default(bufnr) + end end return { |
