Merge pull request #357 from djt308/regex-include
Alter regex for \include to allow completion for \includeonly as well.
This commit is contained in:
commit
4bb7cda82b
@ -608,7 +608,7 @@ function! s:get_main_recurse(file) " {{{1
|
|||||||
let l:file_re = '\s*((.*)\/)?' . fnamemodify(a:file, ':t:r')
|
let l:file_re = '\s*((.*)\/)?' . fnamemodify(a:file, ':t:r')
|
||||||
|
|
||||||
let l:filter = 'v:val =~# ''\v'
|
let l:filter = 'v:val =~# ''\v'
|
||||||
let l:filter .= '\\%(input|include)\{' . l:file_re
|
let l:filter .= '\\%(input|include%(only)?)\{' . l:file_re
|
||||||
let l:filter .= '|\\subimport\{[^\}]*\}\{' . l:file_re
|
let l:filter .= '|\\subimport\{[^\}]*\}\{' . l:file_re
|
||||||
let l:filter .= ''''
|
let l:filter .= ''''
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ endfunction
|
|||||||
" {{{1 Filenames (\input and \include)
|
" {{{1 Filenames (\input and \include)
|
||||||
|
|
||||||
let s:inc = {
|
let s:inc = {
|
||||||
\ 'pattern' : '\v\\%(include|input)\s*\{[^{}]*',
|
\ 'pattern' : '\v\\%(include%(only)?|input)\s*\{[^\{\}]*',
|
||||||
\ 'enabled' : 1,
|
\ 'enabled' : 1,
|
||||||
\}
|
\}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ endfunction
|
|||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
function! vimtex#parser#init_script() " {{{1
|
function! vimtex#parser#init_script() " {{{1
|
||||||
let s:input_line_tex = '\v^\s*\\%(input|include|subimport|subfile)\s*\{'
|
let s:input_line_tex = '\v^\s*\\%(input|include%(only)?|subimport|subfile)\s*\{'
|
||||||
let s:input_line_aux = '\\@input{'
|
let s:input_line_aux = '\\@input{'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -1392,7 +1392,7 @@ documents with |neocomplete| and |vimtex|s omni completion function: >
|
|||||||
\ '\v\\%('
|
\ '\v\\%('
|
||||||
\ . '\a*%(ref|cite)\a*%(\s*\[[^]]*\])?\s*\{[^{}]*'
|
\ . '\a*%(ref|cite)\a*%(\s*\[[^]]*\])?\s*\{[^{}]*'
|
||||||
\ . '|includegraphics%(\s*\[[^]]*\])?\s*\{[^{}]*'
|
\ . '|includegraphics%(\s*\[[^]]*\])?\s*\{[^{}]*'
|
||||||
\ . '|%(include|input)\s*\{[^{}]*'
|
\ . '|%(include%(only)?|input)\s*\{[^\{\}]*'
|
||||||
\ . ')'
|
\ . ')'
|
||||||
<
|
<
|
||||||
YouCompleteMe~
|
YouCompleteMe~
|
||||||
@ -1418,7 +1418,7 @@ To enable automatic completion with |youcompleteme|, use the following options:
|
|||||||
let g:ycm_semantic_triggers.tex = [
|
let g:ycm_semantic_triggers.tex = [
|
||||||
\ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*,?)*',
|
\ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*,?)*',
|
||||||
\ 're!\\includegraphics([^]]*])?{[^}]*',
|
\ 're!\\includegraphics([^]]*])?{[^}]*',
|
||||||
\ 're!\\(include|input){[^}]*'
|
\ 're!\\(include(only)?|input)\{[^\{\}]*'
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user