File tree 1 file changed +20
-2
lines changed
1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -1461,10 +1461,28 @@ M.cmd.ChatFinder = function()
1461
1461
delete_shortcut .modes ,
1462
1462
delete_shortcut .shortcut ,
1463
1463
function ()
1464
+ local mode = vim .api .nvim_get_mode ().mode
1465
+ if mode == " v" then
1466
+ -- get visual selection
1467
+ vim .cmd ([[ execute "normal! \<ESC>"]] )
1468
+ local line1 = vim .api .nvim_buf_get_mark (0 , " <" )[1 ]
1469
+ local line2 = vim .api .nvim_buf_get_mark (0 , " >" )[1 ]
1470
+ vim .g .lines = { line1 , line2 }
1471
+ if line1 == line2 then
1472
+ M .helpers .delete_file (picker_files [line1 ])
1473
+ return
1474
+ end
1475
+ for i = line1 , line2 do
1476
+ local file = picker_files [i ]
1477
+ if file then
1478
+ M .helpers .delete_file (file )
1479
+ end
1480
+ end
1481
+ refresh_picker ()
1482
+ return
1483
+ end -- delete without confirmation
1464
1484
local index = vim .api .nvim_win_get_cursor (picker_win )[1 ]
1465
1485
local file = picker_files [index ]
1466
-
1467
- -- delete without confirmation
1468
1486
if not M .config .chat_confirm_delete then
1469
1487
M .helpers .delete_file (file )
1470
1488
refresh_picker ()
You can’t perform that action at this time.
0 commit comments