Yakov Lerner wrote:
> The following does not work as expected. I wonder
> whether it is a bug or a feature:
>
> cabbr XXX <c-R>="xyz".Left()<cr>
>
> function! Left()
> return "\<Left>"
> endfun
>
> Instead of repositioning cursor left, I get
> :[EMAIL PROTECTED]
> I know It is possible to make it work via feedkeys(), but this
> [EMAIL PROTECTED] does not make much sense, does it ?
>
> I wonder why "\<Left>" is nor recognized here as
> special key ? Is it some sort of bug ?
Special keys are encoded as a special sequence of bytes. In some cases
you want those bytes without the special meaning. It's hard to decide
what was intended.
Considering these two abbreviations:
let foo = "xyz\<Left>"
cabbr XXX <C-R>=foo<CR>
cabbr YYY xyz<Left>
I think XXX and YYY should give the same result. I'll look into it.
--
I'm in shape. Round IS a shape.
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///