Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lua/gp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,25 @@ M.cmd.ChatFinder = function()
delete_shortcut.modes,
delete_shortcut.shortcut,
function()
local mode = vim.api.nvim_get_mode().mode
if mode == "v" then
-- get visual selection
vim.cmd([[execute "normal! \<ESC>"]])
local line1 = vim.api.nvim_buf_get_mark(0, "<")[1]
local line2 = vim.api.nvim_buf_get_mark(0, ">")[1]
if line1 == line2 then
M.helpers.delete_file(picker_files[line1])
return
end
for i = line1, line2 do
local file = picker_files[i]
if file then
M.helpers.delete_file(file)
end
end
refresh_picker()
return
end -- delete without confirmation
local index = vim.api.nvim_win_get_cursor(picker_win)[1]
local file = picker_files[index]

Expand Down
Loading