Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex
In directory sc8-pr-cvs1:/tmp/cvs-serv8259
Modified Files:
texviewer.vim
Log Message:
More bug fixes!
Bug: Pressing <F9> at the end of a line like
This is a \ref{eqn:something} and this is a comp
would cause errors.
Why: The substitute() command returns the original string if the pattern
does not match causing us to wrongly infer a match.
Fix: Therefore first check if there is a match.
Bug: Once we complete an equation, we can never complete a word.
Why: s:type is never unlet
Fix: unlet! s:type if there is no match on current line to any known
command.
Bug: Pressing <CR> during word completion does not take us to the location
of the match, as claimed.
Why: <CR> does "cc <num> | pclose! | cclose!". Because the preview window
with the match is open, therefore cc will take us to the match in
the preview window, after which pclose closes it up!
Fix: Do 'pclose! cc <num> | cclose' instead...
Index: texviewer.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** texviewer.vim 17 Jun 2003 16:22:57 -0000 1.24
--- texviewer.vim 17 Jun 2003 17:26:46 -0000 1.25
***************
*** 81,87 ****
" s:typeoption = '[option=value]'
let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)\?{\(\a\+=\)\?$'
! let s:type = substitute(s:curline, pattern, '\1', 'e')
! let s:typeoption = substitute(s:curline, pattern, '\2', 'e')
! call Tex_Debug('s:type = '.s:type.', typeoption = '.s:typeoption, 'view')
if exists("s:type") && s:type =~ 'ref'
--- 81,92 ----
" s:typeoption = '[option=value]'
let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)\?{\(\a\+=\)\?$'
! if s:curline =~ pattern
! let s:type = substitute(s:curline, pattern, '\1', 'e')
! let s:typeoption = substitute(s:curline, pattern, '\2', 'e')
! call Tex_Debug('s:type = '.s:type.', typeoption = '.s:typeoption, 'view')
! else
! unlet! s:type
! unlet! s:typeoption
! endif
if exists("s:type") && s:type =~ 'ref'
***************
*** 152,156 ****
endif
endif
! exe "silent! grep! '\<".s:word."' ".s:search_directory.'*.tex'
call <SID>Tex_c_window_setup()
--- 157,162 ----
endif
endif
! call Tex_Debug("silent! grep! '\\<".s:word."' ".s:search_directory.'*.tex', 'view')
! exe "silent! grep! '\\<".s:word."' ".s:search_directory.'*.tex'
call <SID>Tex_c_window_setup()
***************
*** 191,194 ****
--- 197,206 ----
$ d _
endif
+ setlocal nonumber
+ setlocal nowrap
+
+ let s:scrollOffVal = &scrolloff
+ call <SID>UpdateViewerWindow()
+
" If everything went well, then we should be situated in the quickfix
" window. If there were problems, (no matches etc), then we will not be.
***************
*** 199,208 ****
endif
- setlocal nonumber
- setlocal nowrap
-
- let s:scrollOffVal = &scrolloff
- call <SID>UpdateViewerWindow()
-
nnoremap <buffer> <silent> j j:call <SID>UpdateViewerWindow()<CR>
nnoremap <buffer> <silent> k k:call <SID>UpdateViewerWindow()<CR>
--- 211,214 ----
***************
*** 407,412 ****
function! s:GoToLocation()
- exe 'cc ' . line('.')
pclose!
cclose
--- 413,418 ----
function! s:GoToLocation()
pclose!
+ exe 'cc ' . line('.')
cclose
***************
*** 533,540 ****
exec 0
let wrap = 'w'
! while search('^\s*\\input', wrap)
let wrap = 'W'
! let filename = matchstr(getline('.'), '\\input{\zs.\{-}\ze}')
let v:errmsg = ''
exec 'silent! find '.filename
--- 539,546 ----
exec 0
let wrap = 'w'
! while search('^\s*\\\(input\|include\)', wrap)
let wrap = 'W'
! let filename = matchstr(getline('.'), '\\\(input\|include\){\zs.\{-}\ze}')
let v:errmsg = ''
exec 'silent! find '.filename
|