[Vim-latex-cvs] vimfiles/ftplugin/latex-suite custommacros.vim,1.9,1.10
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2002-12-27 01:50:01
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv27054 Modified Files: custommacros.vim Log Message: . the menu commands didn't work. Fixed that problem. However, now the commands will be a problem... This has been a long standing problem for me. Will write a better log message later using 'cvs admin -m' Index: custommacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/custommacros.vim,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** custommacros.vim 22 Dec 2002 03:00:37 -0000 1.9 --- custommacros.vim 27 Dec 2002 01:49:58 -0000 1.10 *************** *** 4,8 **** " Version: 1.0 " Created: Tue Apr 23 05:00 PM 2002 PST ! " Last Change: Thu Dec 19 03:00 AM 2002 PST " " Description: functions for processing custom macros in the --- 4,8 ---- " Version: 1.0 " Created: Tue Apr 23 05:00 PM 2002 PST ! " Last Change: Thu Dec 26 05:00 PM 2002 PST " " Description: functions for processing custom macros in the *************** *** 27,31 **** exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fnameshort." :call <SID>DeleteMacro('".fnameshort."')<CR>" exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fnameshort." :call <SID>EditMacro('".fnameshort."')<CR>" ! exe "amenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fnameshort." :call <SID>ReadMacro('".fnameshort."')<CR>" let i = i + 1 endwhile --- 27,32 ---- exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fnameshort." :call <SID>DeleteMacro('".fnameshort."')<CR>" exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fnameshort." :call <SID>EditMacro('".fnameshort."')<CR>" ! exe "imenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fnameshort." <C-r>=<SID>ReadMacro('".fnameshort."')<CR>" ! exe "nmenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fnameshort." i<C-r>=<SID>ReadMacro('".fnameshort."')<CR>" let i = i + 1 endwhile *************** *** 102,127 **** endif let _a = @a ! let fname = glob(s:path."/macros/".filename) ! silent! exec "normal! o¡!¡Temp Line¡!¡\<ESC>k" silent! exec "read ".fname ! silent! exec "normal! V/^¡!¡Temp Line¡!¡$/-1\<CR>\"ax" call Tex_CleanSearchHistory() - - silent! exec "normal! i\<C-r>='¡!¡Start here¡!¡'.IMAP_PutTextWithMovement(@a)\<CR>" - let pos = line('.').'| normal! '.virtcol('.').'|' ! call search('^¡!¡Temp Line¡!¡$') ! . d _ ! call search('¡!¡Start here¡!¡') ! silent! normal! v15l"_x ! call Tex_pack_all() - silent! exe pos - if col('.') < strlen(getline('.')) - silent! normal! l - endif - silent! startinsert endfunction --- 103,129 ---- endif + let fname = s:path.'/macros/'.filename + + let markerString = '<---- Latex Suite End Macro ---->' let _a = @a ! let position = line('.').' | normal! '.virtcol('.').'|' ! silent! call append(line('.'), markerString) silent! exec "read ".fname ! silent! exec "normal! V/^".markerString."$/-1\<CR>\"ax" ! " This is kind of tricky: At this stage, we are one line after the one we ! " started from with the marker text on it. We need to ! " 1. remove the marker and the line. ! " 2. get focus to the previous line. ! " 3. not remove anything from the previous line. ! silent! exec "normal! $v0k$\"_x" ! call Tex_CleanSearchHistory() ! let @a = substitute(@a, '['."\n\r\t ".']*$', '', '') ! let textWithMovement = IMAP_PutTextWithMovement(@a) ! let @a = _a ! return textWithMovement endfunction |