Skip to content

Commit

Permalink
Merge pull request #58 from robinro/cleanup_regexp
Browse files Browse the repository at this point in the history
cleanup filename/line regexp
  • Loading branch information
bogado committed Nov 4, 2015
2 parents f3ff58c + 274a303 commit d7e9831
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions plugin/file_line.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ if exists('g:loaded_file_line') || (v:version < 701)
endif
let g:loaded_file_line = 1

" list with all possible expressions :
" matches file(10) or file(line:col)
" Accept file:line:column: or file:line:column and file:line also
let s:regexpressions = [ '\([^(]\{-1,}\)(\%(\(\d\+\)\%(:\(\d*\):\?\)\?\))', '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?' ]
" below regexp will separate filename and line/column number
" possible inputs to get to line 10 (and column 99) in code.cc are:
" * code.cc(10)
" * code.cc(10:99)
" * code.cc:10
" * code.cc:10:99
"
" closing braces/colons are ignored, so also acceptable are:
" * code.cc(10
" * code.cc:10:
let s:regexpressions = [ '\(.\{-1,}\)[(:]\(\d\+\)\%(:\(\d\+\):\?\)\?' ]

function! s:reopenAndGotoLine(file_name, line_num, col_num)
if !filereadable(a:file_name)
Expand Down

0 comments on commit d7e9831

Please sign in to comment.