Closed blueyed closed 10 years ago
If we're adding more than one reg exp this has to be more generic. I've just added this support.
@bogado Thanks!
I had a local patch to fall back to matching "... line X". Do you think it's useful and should get added to the list of regexps?
diff --git a/plugin/file_line.vim b/plugin/file_line.vim
index 31ea5b4..f3664ff 100644
--- a/plugin/file_line.vim
+++ b/plugin/file_line.vim
@@ -26,7 +26,12 @@ function! s:gotoline()
let names = matchlist( file, '\([^:]*\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?[^: ]\{-}$')
if empty(names)
- return
+ " Handle 'file … line 42'
+ let names = matchlist(file, '\v^(.*) line (\d+)$')
+
+ if empty(names)
+ return
+ endif
end
endif
I have made a more generic way to add different regular expressions to the filename parser. Check the latest version
This also improves the patterns anchoring. I could resist to use
\v
(very-magic).Not much tested.
Fixes #14 (https://github.com/bogado/file-line/issues/14)