[Vim-latex-cvs] vimfiles/ftplugin/tex texviewer.vim,1.7,1.8
Brought to you by:
srinathava,
tmaas
From: <mi...@us...> - 2003-04-11 11:27:29
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv21062a Modified Files: texviewer.vim Log Message: add completion for include, includeonly, input; remove unnecessary g:variables; localization of Tex_Find functions Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** texviewer.vim 10 Apr 2003 22:03:31 -0000 1.7 --- texviewer.vim 11 Apr 2003 11:27:25 -0000 1.8 *************** *** 62,67 **** elseif exists("s:type") && s:type =~ 'cite' silent! grep! nothing % ! let bibfiles = Tex_FindBibFiles() ! let bblfiles = Tex_FindBblFiles() let g:bib = bibfiles let g:bbl = bblfiles --- 62,67 ---- elseif exists("s:type") && s:type =~ 'cite' silent! grep! nothing % ! let bibfiles = <SID>Tex_FindBibFiles() ! let bblfiles = <SID>Tex_FindBblFiles() let g:bib = bibfiles let g:bbl = bblfiles *************** *** 88,91 **** --- 88,103 ---- call <SID>Tex_explore_window("bibliography") + elseif exists("s:type") && s:type =~ 'include\(only\)\=' + let s:storehidefiles = g:explHideFiles + let g:explHideFiles = '^\.,\.[^t]..$' + let s:curfile = expand("%:p") + exe 'silent! Sexplore '.s:search_directory + call <SID>Tex_explore_window("includefile") + + elseif exists("s:type") && s:type == 'input' + let s:curfile = expand("%:p") + exe 'silent! Sexplore '.s:search_directory + call <SID>Tex_explore_window("input") + else let s:word = matchstr(s:curline, '\zs\k\{-}$') *************** *** 171,176 **** --- 183,194 ---- elseif a:type == 'bibliography' nnoremap <silent> <buffer> <cr> :silent! call <SID>CompleteName("bibliography")<CR> + elseif a:type == 'includefile' + nnoremap <silent> <buffer> <cr> :silent! call <SID>CompleteName("includefile")<CR> + elseif a:type == 'input' + nnoremap <silent> <buffer> <cr> :silent! call <SID>CompleteName("input")<CR> endif + nnoremap <silent> <buffer> q :wincmd q<cr> + endfunction " }}} " UpdateViewerWindow: update error and preview window {{{ *************** *** 257,270 **** let completeword = strpart(label, strlen(s:prefix)) ! elseif a:type =~ 'includegraphics\|bibliography' let line = substitute(strpart(getline('.'),0,b:maxFileLen),'\s\+$','','') if isdirectory(b:completePath.line) call EditEntry("", "edit") exe 'nnoremap <silent> <buffer> <cr> :silent! call <SID>CompleteName("'.a:type.'")<CR>' ! let g:explHideFiles = s:storehidefiles return else ! let ifile = substitute(line, '\..\{-}$', '', '') let filename = b:completePath.ifile --- 275,292 ---- let completeword = strpart(label, strlen(s:prefix)) ! elseif a:type =~ 'includegraphics\|bibliography\|includefile\|input' let line = substitute(strpart(getline('.'),0,b:maxFileLen),'\s\+$','','') if isdirectory(b:completePath.line) call EditEntry("", "edit") exe 'nnoremap <silent> <buffer> <cr> :silent! call <SID>CompleteName("'.a:type.'")<CR>' ! nnoremap <silent> <buffer> q :wincmd q<cr> return else ! if a:type != 'input' ! let ifile = substitute(line, '\..\{-}$', '', '') ! else ! let ifile = line ! endif let filename = b:completePath.ifile *************** *** 287,291 **** cclose exe s:pos ! elseif s:type =~ 'includegraphics\|bibliography' wincmd q exe s:pos --- 309,313 ---- cclose exe s:pos ! elseif s:type =~ 'bibliography\|include\|input' wincmd q exe s:pos *************** *** 323,327 **** " Description: scan files looking for \bibliography entries " ! function! Tex_FindBibFiles() let bibfiles = '' --- 345,349 ---- " Description: scan files looking for \bibliography entries " ! function! s:Tex_FindBibFiles() let bibfiles = '' *************** *** 331,344 **** if search('\\bibliography{', 'w') let bibfiles = matchstr(getline('.'), '\\bibliography{\zs.\{-}\ze}') - let g:b1 = bibfiles let bibfiles = substitute(bibfiles, '\(,\|$\)', '.bib ', 'ge') - let g:b2 = bibfiles let bibfiles = substitute(bibfiles, '\(^\| \)', ' '.curdir.'/', 'ge') - let g:b3 = bibfiles else let bibfiles = glob(curdir.'/*.bib') - let g:b4 = bibfiles let bibfiles = substitute(bibfiles, '\n', ' ', 'ge') - let g:b5 = bibfiles endif --- 353,361 ---- *************** *** 358,362 **** endif ! return bibfiles.bibfiles2 endfunction " }}} --- 375,379 ---- endif ! return bibfiles.' '.bibfiles2 endfunction " }}} *************** *** 364,368 **** " Description: scan files looking for \bibitem entries " ! function! Tex_FindBblFiles() let bblfiles = '' --- 381,385 ---- " Description: scan files looking for \bibitem entries " ! function! s:Tex_FindBblFiles() let bblfiles = '' *************** *** 384,388 **** endif ! return bblfiles.bblfiles2 endfunction " }}} --- 401,405 ---- endif ! return bblfiles.' '.bblfiles2 endfunction " }}} |