On 4/15/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
>
> Yakov Lerner wrote:
>
> > In the example below, the 'cabbrev <silent>' doesn't work,
> > while identical cabbrev without <silent> works ok (vim70d02)
> > -----------------------------------------------
> > vim -u cab.vim # where cab.vim is below
> > :GG<space> # this works, produces expected :GG *
> > :BB<space> # doesn't work, does not produce :BB *
> > :BB<space><space> # cursor jumps to column 9, why?
> > :BB<space><space><bs> # finally produces :BB * ...
> >
> > ------------------------------------------------
> > " cab.vim
> > set nocp
> > cabbrev GG GG *<C-R>=Eatchar('\s')<CR>
> > cabbrev <silent> BB BB *<C-R>=Eatchar('\s')<CR>
> >
> > func! Eatchar(pat) "
> > let c = nr2char(getchar(0))
> > return (c =~ a:pat) ? '' : c
> > endfunc
> > --------------------------------------------------
>
> You can see that pressing <BS> shows the text you expected, thus it's a
> redrawing problem. This actually is documented below ":map-silent":
>
> Using "<silent>" for an abbreviation is possible, but will cause
> redrawing of the command line to fail.
Ah, I see. Thanks.
Yakov