From 18a2a4a47d0c6dfc16ea53bcbd87c083df102af2 Mon Sep 17 00:00:00 2001 From: Morten Minde Neergaard <169057+xim@users.noreply.github.com> Date: Wed, 7 Sep 2022 10:12:37 +0200 Subject: [PATCH] Allow opening files with garbage behing colon E.g if someone does a grep and gets output like this: $ grep -r TODO myfile:TODO add some stuff otherfile:TODO other stuff Then I like to just choose a file by double clicking the name and writing e.g. `vim myfile:TODO` without having to erase the TODO bit. This is accomplished by allowing zero digits in the line number. --- plugin/file_line.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/file_line.vim b/plugin/file_line.vim index 7244014..6ad7253 100644 --- a/plugin/file_line.vim +++ b/plugin/file_line.vim @@ -14,7 +14,7 @@ let g:loaded_file_line = 1 " closing braces/colons are ignored, so also acceptable are: " * code.cc(10 " * code.cc:10: -let s:regexpressions = [ '\(.\{-1,}\)[(:]\(\d\+\)\%(:\(\d\+\):\?\)\?' ] +let s:regexpressions = [ '\(.\{-1,}\)[(:]\(\d*\)\%(:\(\d\+\):\?\)\?', ] function! s:reopenAndGotoLine(file_name, line_num, col_num) if !filereadable(a:file_name)