Re: [Vim-latex-devel] new version of imaps.vim
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2002-12-14 20:38:23
|
This is bad! We have a problem with vim's limitation of only letting functions take upto 20 arguments... On Sat, 14 Dec 2002, Benji Fisher wrote: > > NOTE: This is a work in progress. the changed version of Tex_IMAP() is not > > yet working quite robustly enought. It is sometimes generating more > > arguments than are needed. > > Examples? Maybe my simplified version will work better. Thanks for the simplifications! Turns out the Tex_IMAP() function was fine. But the following call Tex_IMAP('EPI', "\\begin{picture}(<+width+>, <+height+>)" \ . "(<+xoff+>,<+yoff+>)\<cr>\\put(<+xoff+>,<+yoff+>)" \ . "{\\framebox(<++>,<++>){<++>}}\<cr>\\end{picture}<++>", \ 'tex') creates more than 20 arguments! Now what? A long term solution to this problem is ofcourse changing vim to be more script friendly and accept more than 20 arguments (Its bad that there are limitations in the first place!). But I suspect that Bram will most probably ask us to use some hack to get around the limitation rather than change things... And even if he does change it, it will be bad to make latex-suite depend on the very latest vim being installed. So... Whats the hack around it? Maybe if IMAP() is called with the same LHS more than once, it appends this RHS to the previous RHS? Then change Tex_IMAP() to call IMAP() with chunks of 20 arguments each time? This is sad... A simple function getting needlessly complex. I'll let others think about it / implement it :) About imaps... For sometime I have been thinking of having IMAPS() take a flag which makes it "safe", i.e if the user defines other mappings with the same LHS before latex-suite, it will not override his mappings... Now the flag argument could also be useful for telling us whether this is part of an append or an entirely new RHS... The flag cannot be optional. It will have to be left as '' if we just want it to overwrite like now. > Can you test this? It might be a solution to the remaining > encoding problems. > > :let foo = "\xab" > :echo iconv(foo, "latin1", &enc) =~ foo > Yes. This seems to echo 1 with encoding set to both 'latin1' and 'utf8'... Another thing to note: There seem to be a lot of patches in vim 6.0 towards MB chars... Therefore, maybe we should only test on vim 6.0 w/o patches henceforth, so we have the safest... Srinath -- Srinath Avadhanula Dec 14 12:13pm According to Arkansas law, Section 4761, Pope's Digest: "No person shall be permitted under any pretext whatever, to come nearer than fifty feet of any door or window of any polling room, from the opening of the polls until the completion of the count and the certification of the returns." |