[Vim-latex-cvs] vimfiles/ftplugin/latex-suite main.vim,1.55,1.56
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2003-12-14 23:31:13
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv17343/latex-suite Modified Files: main.vim Log Message: Change: Making Tex_EscapeForGrep more cross-platform. Use this henceforth whenever a :grep command needs to be issued. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** main.vim 14 Dec 2003 07:13:44 -0000 1.55 --- main.vim 14 Dec 2003 23:31:10 -0000 1.56 *************** *** 535,545 **** " search pattern the correct number of times so it can be used in the :grep " command. This command is meant to be used as: ! " exec "silent! grep '".Tex_EscapeForGrep(pattern)."' file" ! " NOTE: The pattern in the grep command should _always_ be enclosed in ! " single quotes (not double quotes) for robust performance. function! Tex_EscapeForGrep(string) " This first escaping is so that grep gets a string like '\\bibitem' when " we want to search for a string like '\bibitem'. let retVal = escape(a:string, "\\") " The next escape is because when the shellxquote is ", then the grep " commad is usually called as --- 535,544 ---- " search pattern the correct number of times so it can be used in the :grep " command. This command is meant to be used as: ! " exec "silent! grep ".Tex_EscapeForGrep(pattern)." file" function! Tex_EscapeForGrep(string) " This first escaping is so that grep gets a string like '\\bibitem' when " we want to search for a string like '\bibitem'. let retVal = escape(a:string, "\\") + " The next escape is because when the shellxquote is ", then the grep " commad is usually called as *************** *** 547,553 **** " which means that we need to escape backslashes (because they get halved) " and also double quotes. ! if &shellxquote == '"' ! let retVal = escape(retVal, "\"\\") endif return retVal endfunction " }}} --- 546,556 ---- " which means that we need to escape backslashes (because they get halved) " and also double quotes. ! if &shell =~ 'sh' ! let retVal = escape(retVal, "\\") ! if &shellxquote == '"' ! let retVal = escape(retVal, "\"\\") ! endif endif + return retVal endfunction " }}} |