Yet another tweak to filepath matching
dblume

dblume commited on 2025-11-15 23:04:02
Showing 1 changed files, with 1 additions and 1 deletions.


* exclude the // in https://path/file
* Only allow basename:## if basename has a letter in it.
  to avoid 10:30, which is more likely a time than line 30 of file "10".
... ...
@@ -44,7 +44,7 @@ bind -n M-l select-pane -R
44 44
 # 3. Navigate selections with n/N.
45 45
 # 4. Once found, o to open the file in $EDITOR.
46 46
 bind-key f copy-mode \; send-keys -X search-backward \
47
-  '(^|\<|[[:space:]/])(("([[:alnum:] _\.#$%&+=@-]+|~)?(/[[:alnum:] _\.#$%&+=@-]+)*"|([[:alnum:]_\.#$%&+=@-]+|~)?(/[[:alnum:]_\.#$%&+=@-]+)+|[[:alnum:]_\.#$%&+=@-]+[[:alpha:]_\.\#$%&+=@-])(:[0-9]{1,10})|([[:alnum:]_\.#$%&+=@-]+|~)?(/[[:alnum:]_\.#$%&+=@-]+){2,}(:[0-9]{1,10})?)(:[0-9]{1,10})?'
47
+  '(^|\<|[[:space:]])(("([[:alnum:] _\.#$%&+=@-]+|~)?(/[[:alnum:] _\.#$%&+=@-]+)*"|([[:alnum:]_\.#$%&+=@-]+|~)?(/[[:alnum:]_\.#$%&+=@-]+)+|[[:alnum:]_\.#$%&+=@-]*[[:alpha:]][[:alnum:]_\.#$%&+=@-]*)(:[0-9]{1,10})|([[:alnum:]_\.#$%&+=@-]+|~)?(/[[:alnum:]_\.#$%&+=@-]+){2,}(:[0-9]{1,10})?)(:[0-9]{1,10})?'
48 48
 
49 49
 # save the buffer, then open an editor in the current pane
50 50
 bind-key -T copy-mode-vi o send-keys -X copy-pipe-and-cancel \
51 51