@@ -445,13 +445,7 @@ function M.get_visual_selection()
445
445
local start_coords , end_coords = get_selection_coordinates ()
446
446
447
447
local current_buf = vim .api .nvim_get_current_buf ()
448
- local raw_file_path = vim .api .nvim_buf_get_name (current_buf )
449
-
450
- -- Extract real filesystem path from mini.files buffer path if needed
451
- local file_path = raw_file_path
452
- if file_path :match (" ^minifiles://" ) then
453
- file_path = file_path :gsub (" ^minifiles://[^/]*/" , " " )
454
- end
448
+ local file_path = vim .api .nvim_buf_get_name (current_buf )
455
449
456
450
local lines_content = vim .api .nvim_buf_get_lines (
457
451
current_buf ,
496
490
function M .get_cursor_position ()
497
491
local cursor_pos = vim .api .nvim_win_get_cursor (0 )
498
492
local current_buf = vim .api .nvim_get_current_buf ()
499
- local raw_file_path = vim .api .nvim_buf_get_name (current_buf )
500
-
501
- -- Extract real filesystem path from mini.files buffer path if needed
502
- local file_path = raw_file_path
503
- if file_path :match (" ^minifiles://" ) then
504
- file_path = file_path :gsub (" ^minifiles://[^/]*/" , " " )
505
- end
493
+ local file_path = vim .api .nvim_buf_get_name (current_buf )
506
494
507
495
return {
508
496
text = " " ,
@@ -596,13 +584,7 @@ function M.get_range_selection(line1, line2)
596
584
end
597
585
598
586
local current_buf = vim .api .nvim_get_current_buf ()
599
- local raw_file_path = vim .api .nvim_buf_get_name (current_buf )
600
-
601
- -- Extract real filesystem path from mini.files buffer path if needed
602
- local file_path = raw_file_path
603
- if file_path :match (" ^minifiles://" ) then
604
- file_path = file_path :gsub (" ^minifiles://[^/]*/" , " " )
605
- end
587
+ local file_path = vim .api .nvim_buf_get_name (current_buf )
606
588
607
589
-- Get the total number of lines in the buffer
608
590
local total_lines = vim .api .nvim_buf_line_count (current_buf )
@@ -686,13 +668,7 @@ function M.send_at_mention_for_visual_selection(line1, line2)
686
668
end
687
669
688
670
-- Sanity check: ensure the selection is for the current buffer
689
- local raw_current_buf_name = vim .api .nvim_buf_get_name (vim .api .nvim_get_current_buf ())
690
-
691
- -- Extract real filesystem path from mini.files buffer path if needed
692
- local current_buf_name = raw_current_buf_name
693
- if current_buf_name :match (" ^minifiles://" ) then
694
- current_buf_name = current_buf_name :gsub (" ^minifiles://[^/]*/" , " " )
695
- end
671
+ local current_buf_name = vim .api .nvim_buf_get_name (vim .api .nvim_get_current_buf ())
696
672
697
673
if sel_to_send .filePath ~= current_buf_name then
698
674
logger .warn (
0 commit comments