Re: [Vim-latex-cvs] vimfiles/plugin imaps.vim,1.14,1.15
Brought to you by:
srinathava,
tmaas
From: Benji F. <be...@me...> - 2002-12-31 14:58:58
|
Srinath Avadhanula wrote: > On Mon, 30 Dec 2002, Benji Fisher wrote: > > Yes. Positioning using movement is the best... The problem I ran across > was that if you do something like > > :set encoding=utf8 > :let bar = "?" > (where the ? character is typed using <C-v><<) > :echo strlen(bar) > 2 > > Can this problem be taken care of using the change in encoding etc? > Hmm... I see that > :echo strlen(iconv(bar, &encoding, 'latin1')) > 1 > :echo strlen(substitute(bar, '.', 'x', 'g')) > 1 > > So those two methods might work... It will be a definite improvement > over the current "hack". I think we should try this. Another new branch? Personally, I prefer the substitute() approach over iconv(), because I think I understand it better. > On a different note: > > imaps.vim now contains: > > let textEnc = iconv(text, "latin1", &enc) > [snip] > > " If there are no place holders, just return the text. > if textEnc !~ '\V'.phs.'\.\{-}'.phe > return text > endif > > Shouldn't the comparision be: > > " If there are no place holders, just return the text. > if textEnc !~ '\V'.phsEnc.'\.\{-}'.pheEnc > return text > endif > > Maybe this is why Fabio is having that problem? > > I am wary of making any changes here because I haven't thought about > this as much as you have... Well, I have experimented a lot. Remember the experiments I asked you to repeat, :let foo = "\xab" :echo foo =~ foo :echo iconv(foo, 'latin1', &enc) =~ foo Your variant may also work, but I did it this way on purpose. AFAICT it works. --Benji |