From f535f07a6d3bc0a0776f76693d1ba0ad446a36a7 Mon Sep 17 00:00:00 2001 From: slaiba Date: Thu, 26 Jan 2017 20:05:44 +0100 Subject: [PATCH] Modified complete.vim to improve parsing of equation numbers and support subfile command --- autoload/vimtex/complete.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/vimtex/complete.vim b/autoload/vimtex/complete.vim index 703a45f..7be6ceb 100644 --- a/autoload/vimtex/complete.vim +++ b/autoload/vimtex/complete.vim @@ -366,7 +366,8 @@ function! s:ref.parse_number(num_tree) dict " {{{2 return self.parse_number(a:num_tree[l:index]) endif else - return str2nr(a:num_tree) > 0 ? a:num_tree : '-' + let l:matches = matchlist(a:num_tree, '\v(^|.*\s)((\u|\d+)(\.\d+)*)($|\s.*)') + return len(l:matches) > 3 ? l:matches[2] : '-' endif endfunction @@ -438,7 +439,7 @@ endfunction " {{{1 Filenames (\input and \include) let s:inc = { - \ 'patterns' : ['\v\\%(include%(only)?|input)\s*\{[^}]*$'], + \ 'patterns' : ['\v\\%(include%(only)?|input|subfile)\s*\{[^}]*$'], \} function! s:inc.complete(regex) dict " {{{2