[Vim-latex-cvs] vimfiles/ftplugin/latex-suite main.vim,1.41,1.42
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2003-07-16 16:44:46
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv32760 Modified Files: main.vim Log Message: Bug: If g:Tex_SmartQuoteOpen/Close contain the '~' character (french quotes are "«~" and "~»", then we get an error in quotations (Mathieu Clabaut). Fix: escape ~ in the search() function (Mathieu Clabaut). Change: make Tex_GetMainFile() recursively search upwards for a *.latexmain file. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** main.vim 10 Jul 2003 09:52:11 -0000 1.41 --- main.vim 16 Jul 2003 16:44:41 -0000 1.42 *************** *** 228,232 **** while 1 " Look for preceding quote (open or close), ignoring " math mode and '\"' . ! call search(open . boundary . close . '\|^$\|"', "bw") if synIDattr(synID(line("."), col("."), 1), "name") !~ "^texMath" \ && (col(".") == 1 || getline(".")[col(".")-2] != '\') --- 228,232 ---- while 1 " Look for preceding quote (open or close), ignoring " math mode and '\"' . ! call search(escape(open . boundary . close . '\|^$\|"', "~"), "bw") if synIDattr(synID(line("."), col("."), 1), "name") !~ "^texMath" \ && (col(".") == 1 || getline(".")[col(".")-2] != '\') *************** *** 401,416 **** let modifier = ':p:r:r' endif let curd = getcwd() ! exe 'cd '.expand('%:p:h') let lheadfile = glob('*.latexmain') - " dirty hack to check in dir one level up. TODO: while with ":h" mod. - if lheadfile == '' - cd .. - let lheadfile = glob('*.latexmain') - endif if lheadfile != '' let lheadfile = fnamemodify(lheadfile, modifier) endif ! exe 'cd '.curd return lheadfile endfunction --- 401,432 ---- let modifier = ':p:r:r' endif + let curd = getcwd() ! ! let dirmodifier = '%:p:h' ! let dirLast = expand(dirmodifier) ! " escape spaces whenever we use cd (diego Caraffini) ! exe 'cd '.escape(dirLast, ' ') ! ! " move up the directory tree until we find a .latexmain file. ! " TODO: Should we be doing this recursion by default, or should there be a ! " setting? ! while glob('*.latexmain') == '' ! let dirmodifier = dirmodifier.':h' ! " break from the loop if we cannot go up any further. ! if expand(dirmodifier) == dirLast ! break ! endif ! let dirLast = expand(dirmodifier) ! exec 'cd '.escape(dirLast, ' ') ! endwhile ! let lheadfile = glob('*.latexmain') if lheadfile != '' let lheadfile = fnamemodify(lheadfile, modifier) endif ! ! exe 'cd '.escape(curd, ' ') ! return lheadfile endfunction |