diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-05-05 14:26:41 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-05-05 14:26:41 +0200 |
commit | 85de20665f3ed48345b79cd0920af41397544141 (patch) | |
tree | b98afef3eb7390370eb7fd46ab0bcedd712da5f4 /src/ex_docmd.c | |
parent | 72bb0d64554d671deb70724774f2a93c2d17c407 (diff) |
updated for version 7.3.171v7.3.171
Problem: When the clipboard isn't supported: ":yank*" gives a confusing
error message.
Solution: Specifically mention that the register name is invalid.
(Jean-Rene David)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index b67c00be5e..d90e964424 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2424,25 +2424,39 @@ do_one_cmd(cmdlinep, sourcing, if ( (ea.argt & REGSTR) && *ea.arg != NUL #ifdef FEAT_USR_CMDS - && valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put - && USER_CMDIDX(ea.cmdidx))) /* Do not allow register = for user commands */ && (!USER_CMDIDX(ea.cmdidx) || *ea.arg != '=') -#else - && valid_yank_reg(*ea.arg, ea.cmdidx != CMD_put) #endif && !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg))) { - ea.regname = *ea.arg++; -#ifdef FEAT_EVAL - /* for '=' register: accept the rest of the line as an expression */ - if (ea.arg[-1] == '=' && ea.arg[0] != NUL) +#ifndef FEAT_CLIPBOARD + /* check these explicitly for a more specific error message */ + if (*ea.arg == '*' || *ea.arg == '+') { - set_expr_line(vim_strsave(ea.arg)); - ea.arg += STRLEN(ea.arg); + errormsg = (char_u *)_(e_invalidreg); + goto doend; } #endif - ea.arg = skipwhite(ea.arg); + if ( +#ifdef FEAT_USR_CMDS + valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put + && USER_CMDIDX(ea.cmdidx))) +#else + valid_yank_reg(*ea.arg, ea.cmdidx != CMD_put) +#endif + ) + { + ea.regname = *ea.arg++; +#ifdef FEAT_EVAL + /* for '=' register: accept the rest of the line as an expression */ + if (ea.arg[-1] == '=' && ea.arg[0] != NUL) + { + set_expr_line(vim_strsave(ea.arg)); + ea.arg += STRLEN(ea.arg); + } +#endif + ea.arg = skipwhite(ea.arg); + } } /* |