]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.171 v7.3.171
authorBram Moolenaar <Bram@vim.org>
Thu, 5 May 2011 12:26:41 +0000 (14:26 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 5 May 2011 12:26:41 +0000 (14:26 +0200)
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)

runtime/doc/change.txt
src/ex_docmd.c
src/globals.h
src/version.c

index fe518d150217c1d6d3d949c44ee95698ddad6784..6e531114544618160fed4002f61737acfaf4633d 100644 (file)
@@ -917,8 +917,10 @@ inside of strings can change!  Also see 'softtabstop' option. >
 {Visual}["x]Y          Yank the highlighted lines [into register x] (for
                        {Visual} see |Visual-mode|).  {not in Vi}
 
-                                                       *:y* *:yank*
-:[range]y[ank] [x]     Yank [range] lines [into register x].
+                                                       *:y* *:yank* *E850*
+:[range]y[ank] [x]     Yank [range] lines [into register x]. Yanking to the
+                       "* or "+ registers is possible only in GUI versions or
+                       when the |+xterm_clipboard| feature is included.
 
 :[range]y[ank] [x] {count}
                        Yank {count} lines, starting with last line number
index b67c00be5e15db4f58221d5d7d0b070c0ba293a0..d90e9644240083da846ae6561961a4c9871c1b42 100644 (file)
@@ -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);
+       }
     }
 
     /*
index 3685fc7322d1c0cff673b1b113454d89a040a805..4b5544686919d4b09c9343c3c8f6c752ff5f34d8 100644 (file)
@@ -1561,6 +1561,9 @@ EXTERN char_u e_bufloaded[]       INIT(= N_("E139: File is loaded in another buffer"))
        (defined(FEAT_INS_EXPAND) && defined(FEAT_COMPL_FUNC))
 EXTERN char_u e_notset[]       INIT(= N_("E764: Option '%s' is not set"));
 #endif
+#ifndef FEAT_CLIPBOARD
+EXTERN char_u e_invalidreg[]    INIT(= N_("E850: Invalid register name"));
+#endif
 
 #ifdef MACOS_X_UNIX
 EXTERN short disallow_gui      INIT(= FALSE);
index 51e2cf9726f70e25cd6e708304862f350de72e87..b99456a539183f2f176fdfef316b194383356095 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    171,
 /**/
     170,
 /**/