Skip to content

Commit

Permalink
properly working multi-select telescope
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpalmer committed Nov 30, 2021
1 parent 57d4fea commit 9af035b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions public dots/vim-nvim/lua/joel/telescope/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ function custom_actions._multiopen(prompt_bufnr, open_cmd)
local picker = action_state.get_current_picker(prompt_bufnr)
local num_selections = #picker:get_multi_selection()
if num_selections > 1 then
local picker = action_state.get_current_picker(prompt_bufnr)
local cwd = picker.cwd
if cwd == nil then
cwd = ""
else
cwd = string.format("%s/", cwd)
end
vim.cmd "bw!"
for _, entry in ipairs(picker:get_multi_selection()) do
vim.cmd(string.format("%s %s", open_cmd, entry.value))
vim.cmd(string.format("%s %s%s", open_cmd, cwd, entry.value))
end
vim.cmd "stopinsert"
else
Expand Down Expand Up @@ -269,7 +274,7 @@ function M.find_configs()
"~/.config/nvim",
"~/.config/alacritty",
},
cwd = "~/.config/nvim/",
-- cwd = "~/.config/nvim/",
layout_strategy = "horizontal",
layout_config = { preview_width = 0.65, width = 0.75 },
}
Expand Down

0 comments on commit 9af035b

Please sign in to comment.