[Vim-latex-cvs] vimfiles/ftplugin/latex-suite main.vim,1.76,1.77
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2004-08-26 17:52:55
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22849 Modified Files: main.vim Log Message: Bug: When the open and close quote patterns contain the \ character, then the qoute completion fails. Pressing " always inserts the open quote string. Fix: Escape the Tex_SmartQuoteOpen and Tex_SmartQuoteClose while searching backwards. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** main.vim 5 Aug 2004 23:04:27 -0000 1.76 --- main.vim 26 Aug 2004 17:52:45 -0000 1.77 *************** *** 606,610 **** " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.11" endfunction --- 606,610 ---- " keep that as a stable point. function! Tex_Version() ! return "Latex-Suite: version 1.6.12" endfunction *************** *** 654,658 **** let boundary = '\|' " This code seems to be obsolete, since this script variable is never ! " set. The idea is that some languages use ",," as an open- or " close-quote string, and we want to avoid confusing ordinary "," " with a quote boundary. --- 654,658 ---- let boundary = '\|' " This code seems to be obsolete, since this script variable is never ! " set. The idea is that some languages use ",," as an open- or " close-quote string, and we want to avoid confusing ordinary "," " with a quote boundary. *************** *** 665,683 **** endif endif " Eventually return q; set it to the default value now. let q = open 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] != '\') break endif endwhile " Now, test whether we actually found a _preceding_ quote; if so, is it " an open quote? if ( line(".") < l || line(".") == l && col(".") < c ) ! if strpart(getline("."), col(".")-1) =~ ! \ '\V\^' . escape(open, '\') if line(".") == l && col(".") + strlen(open) == c " Insert "<++>''<++>" instead of just "''". --- 665,690 ---- endif endif + " Eventually return q; set it to the default value now. let q = open + let pattern = + \ escape(open, '\~') . + \ boundary . + \ escape(close, '\~') . + \ '\|^$\|"' + while 1 " Look for preceding quote (open or close), ignoring " math mode and '\"' . ! call search(pattern, "bw") if synIDattr(synID(line("."), col("."), 1), "name") !~ "^texMath" ! \ && strpart(getline('.'), col('.')-2, 2) != '\"' break endif endwhile + " Now, test whether we actually found a _preceding_ quote; if so, is it " an open quote? if ( line(".") < l || line(".") == l && col(".") < c ) ! if strpart(getline("."), col(".")-1) =~ '\V\^' . escape(open, '\') if line(".") == l && col(".") + strlen(open) == c " Insert "<++>''<++>" instead of just "''". *************** *** 688,695 **** --- 695,704 ---- endif endif + " Return to line l, column c: execute restore_cursor " Start with <Del> to remove the " put in by the :imap . return "\<Del>" . q + endfunction |