Re: [Vim-latex-devel] German quotation marks and `
Brought to you by:
srinathava,
tmaas
From: Benji F. <be...@me...> - 2003-01-16 20:49:17
|
Srinath Avadhanula wrote: > On Thu, 16 Jan 2003, Benji Fisher wrote: > > >>" maybe off by one: >>:let line = strpart(getline("."), col(".")).a:char >>:let line = substitute(line, '\V\.\*\('.s:ProtectStrings.'\)', '', '') >> >>(I am not sure whether a:char should be appended before or after the >>substitute() line.) The script variable can have the form >> >>s:ProtectStrings = '\\`' . '\|' . '"`' >> >>(note that IMAP_Protect() applies escape(..., '\') before adding >>something to the script variable). Then, if the line up to the cursor >>contains either of the strings '\`' or '"`', everything up to and >>including the last occurrence will be removed by the substitute(). > > Okay, after reading this a few times, I see what you mean... Just to > clarify, when we press a letter 'a' at the end of a line like > > A quote starts `` > > then, instead of trying to find out if the string > "A quote starts ``a" matches with an LHS, we first remove the `` and > then try to see if "A quote starts a" matches with an available lhs? No: strip off '.*``' and check whether "a" matches any lhs. > That will certainly work. (Although removing s:ProtectStrings everywhere > is not necessary, only from the end no?) > > Do you think we need to do this still? The present system of creating > fake maps seems to work as of now... If you still think we need this, > please go ahead and add this... You'll also need to remove the > s:ProtectLetters() function from main.vim and add in a couple of > IMAP_Protect()'s instead.... Which version is more scalable? If the current system is working and is easy to extend, I will not try to fix it. --Benji |