[Vim-latex-cvs] vimfiles/ftplugin/latex-suite main.vim,1.30,1.31
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2003-01-15 02:54:31
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv24135 Modified Files: main.vim Log Message: - new function Tex_CreatePrompt. " Description: " Arguments: " promptList: This is a string of the form: " 'item1,item2,item3,item4' " cols: the number of columns in the resultant prompt " sep: the list seperator token " " Example: " Tex_CreatePrompt('item1,item2,item3,item4', 2, ',') " returns " "(1) item1\t(2)item2\n(3)item3\t(4)item4" " " This string can be used in the input() function. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** main.vim 14 Jan 2003 22:51:19 -0000 1.30 --- main.vim 15 Jan 2003 02:54:28 -0000 1.31 *************** *** 318,321 **** --- 318,362 ---- " }}} + " Tex_CreatePrompt: creates a prompt string {{{ + " Description: + " Arguments: + " promptList: This is a string of the form: + " 'item1,item2,item3,item4' + " cols: the number of columns in the resultant prompt + " sep: the list seperator token + " + " Example: + " Tex_CreatePrompt('item1,item2,item3,item4', 2, ',') + " returns + " "(1) item1\t(2)item2\n(3)item3\t(4)item4" + " + " This string can be used in the input() function. + function! Tex_CreatePrompt(promptList, cols, sep) + + let g:listSep = a:sep + let num_common = GetListCount(a:promptList) + + let i = 1 + let promptStr = "" + + while i <= num_common + + let j = 0 + while j < a:cols && i + j <= num_common + let com = Tex_Strntok(a:promptList, ',', i+j) + let promptStr = promptStr.'('.(i+j).') '. + \ com."\t".( strlen(com) < 4 ? "\t" : '' ) + + let j = j + 1 + endwhile + + let promptStr = promptStr."\n" + + let i = i + a:cols + endwhile + return promptStr + endfunction + + " }}} " Tex_CleanSearchHistory: removes last search item from search history {{{ " Description: This function needs to be globally visible because its |