home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.074 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  7.5 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.074
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.074
  11. Problem:    Can't use the "+ register like "* for yank and put.
  12. Solution:   Add "unnamedplus" to the 'clipboard' option. (Ivan Krasilnikov)
  13. Files:        runtime/doc/options.txt, src/eval.c, src/globals.h, src/ops.c,
  14.         src/option.c
  15.  
  16.  
  17. *** ../vim-7.3.073/runtime/doc/options.txt    2010-12-02 16:01:23.000000000 +0100
  18. --- runtime/doc/options.txt    2010-12-02 21:22:48.000000000 +0100
  19. ***************
  20. *** 1434,1439 ****
  21. --- 1434,1448 ----
  22.               explicitly accessed using the "* notation.  Also see
  23.               |gui-clipboard|.
  24.   
  25. +     unnamedplus    A variant of "unnamed" flag which uses the clipboard
  26. +             register '+' (|quoteplus|) instead of register '*' for
  27. +             all operations except yank.  Yank shall copy the text
  28. +             into register '+' and also into '*' when "unnamed" is
  29. +             included.
  30. +             Only available with the |+x11| feature.
  31. +             Availability can be checked with: >
  32. +                 if has('unnamedplus')
  33. + <
  34.       autoselect    Works like the 'a' flag in 'guioptions': If present,
  35.               then whenever Visual mode is started, or the Visual
  36.               area extended, Vim tries to become the owner of the
  37. *** ../vim-7.3.073/src/eval.c    2010-12-02 14:47:56.000000000 +0100
  38. --- src/eval.c    2010-12-02 17:30:23.000000000 +0100
  39. ***************
  40. *** 12135,12140 ****
  41. --- 12139,12147 ----
  42.   #ifdef FEAT_TOOLBAR
  43.       "toolbar",
  44.   #endif
  45. + #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
  46. +     "unnamedplus",
  47. + #endif
  48.   #ifdef FEAT_USR_CMDS
  49.       "user-commands",    /* was accidentally included in 5.4 */
  50.       "user_commands",
  51. *** ../vim-7.3.073/src/globals.h    2010-11-24 14:28:53.000000000 +0100
  52. --- src/globals.h    2010-12-02 20:07:42.000000000 +0100
  53. ***************
  54. *** 512,518 ****
  55.   #  define clip_plus clip_star    /* there is only one clipboard */
  56.   #  define ONE_CLIPBOARD
  57.   # endif
  58. ! EXTERN int    clip_unnamed INIT(= FALSE);
  59.   EXTERN int    clip_autoselect INIT(= FALSE);
  60.   EXTERN int    clip_autoselectml INIT(= FALSE);
  61.   EXTERN int    clip_html INIT(= FALSE);
  62. --- 512,522 ----
  63.   #  define clip_plus clip_star    /* there is only one clipboard */
  64.   #  define ONE_CLIPBOARD
  65.   # endif
  66. ! #define CLIP_UNNAMED      1
  67. ! #define CLIP_UNNAMED_PLUS 2
  68. ! EXTERN int    clip_unnamed INIT(= 0); /* above two values or'ed */
  69.   EXTERN int    clip_autoselect INIT(= FALSE);
  70.   EXTERN int    clip_autoselectml INIT(= FALSE);
  71.   EXTERN int    clip_html INIT(= FALSE);
  72. *** ../vim-7.3.073/src/ops.c    2010-11-24 14:28:53.000000000 +0100
  73. --- src/ops.c    2010-12-02 21:33:04.000000000 +0100
  74. ***************
  75. *** 1584,1592 ****
  76.   adjust_clip_reg(rp)
  77.       int        *rp;
  78.   {
  79. !     /* If no reg. specified, and "unnamed" is in 'clipboard', use '*' reg. */
  80. !     if (*rp == 0 && clip_unnamed)
  81. !     *rp = '*';
  82.       if (!clip_star.available && *rp == '*')
  83.       *rp = 0;
  84.       if (!clip_plus.available && *rp == '+')
  85. --- 1584,1594 ----
  86.   adjust_clip_reg(rp)
  87.       int        *rp;
  88.   {
  89. !     /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard',
  90. !      * use '*' or '+' reg, respectively. "unnamedplus" prevails. */
  91. !     if (*rp == 0 && clip_unnamed != 0)
  92. !     *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available)
  93. !                                   ? '+' : '*';
  94.       if (!clip_star.available && *rp == '*')
  95.       *rp = 0;
  96.       if (!clip_plus.available && *rp == '+')
  97. ***************
  98. *** 2842,2847 ****
  99. --- 2844,2850 ----
  100.       char_u        *p;
  101.       char_u        *pnew;
  102.       struct block_def    bd;
  103. +     int            did_star = FALSE;
  104.   
  105.                       /* check for read-only register */
  106.       if (oap->regname != 0 && !valid_yank_reg(oap->regname, TRUE))
  107. ***************
  108. *** 3115,3121 ****
  109.        */
  110.       if (clip_star.available
  111.           && (curr == &(y_regs[STAR_REGISTER])
  112. !         || (!deleting && oap->regname == 0 && clip_unnamed)))
  113.       {
  114.       if (curr != &(y_regs[STAR_REGISTER]))
  115.           /* Copy the text from register 0 to the clipboard register. */
  116. --- 3118,3125 ----
  117.        */
  118.       if (clip_star.available
  119.           && (curr == &(y_regs[STAR_REGISTER])
  120. !         || (!deleting && oap->regname == 0
  121. !                        && (clip_unnamed & CLIP_UNNAMED))))
  122.       {
  123.       if (curr != &(y_regs[STAR_REGISTER]))
  124.           /* Copy the text from register 0 to the clipboard register. */
  125. ***************
  126. *** 3123,3128 ****
  127. --- 3127,3133 ----
  128.   
  129.       clip_own_selection(&clip_star);
  130.       clip_gen_set_selection(&clip_star);
  131. +     did_star = TRUE;
  132.       }
  133.   
  134.   # ifdef FEAT_X11
  135. ***************
  136. *** 3130,3141 ****
  137.        * If we were yanking to the '+' register, send result to selection.
  138.        * Also copy to the '*' register, in case auto-select is off.
  139.        */
  140. !     else if (clip_plus.available && curr == &(y_regs[PLUS_REGISTER]))
  141.       {
  142.       /* No need to copy to * register upon 'unnamed' now - see below */
  143.       clip_own_selection(&clip_plus);
  144.       clip_gen_set_selection(&clip_plus);
  145. !     if (!clip_isautosel())
  146.       {
  147.           copy_yank_reg(&(y_regs[STAR_REGISTER]));
  148.           clip_own_selection(&clip_star);
  149. --- 3135,3153 ----
  150.        * If we were yanking to the '+' register, send result to selection.
  151.        * Also copy to the '*' register, in case auto-select is off.
  152.        */
  153. !     if (clip_plus.available
  154. !         && (curr == &(y_regs[PLUS_REGISTER])
  155. !         || (!deleting && oap->regname == 0
  156. !                       && (clip_unnamed & CLIP_UNNAMED_PLUS))))
  157.       {
  158. +     if (curr != &(y_regs[PLUS_REGISTER]))
  159. +         /* Copy the text from register 0 to the clipboard register. */
  160. +         copy_yank_reg(&(y_regs[PLUS_REGISTER]));
  161.       /* No need to copy to * register upon 'unnamed' now - see below */
  162.       clip_own_selection(&clip_plus);
  163.       clip_gen_set_selection(&clip_plus);
  164. !     if (!clip_isautosel() && !did_star)
  165.       {
  166.           copy_yank_reg(&(y_regs[STAR_REGISTER]));
  167.           clip_own_selection(&clip_star);
  168. *** ../vim-7.3.073/src/option.c    2010-12-02 16:01:23.000000000 +0100
  169. --- src/option.c    2010-12-02 21:41:32.000000000 +0100
  170. ***************
  171. *** 7307,7313 ****
  172.       static char_u *
  173.   check_clipboard_option()
  174.   {
  175. !     int        new_unnamed = FALSE;
  176.       int        new_autoselect = FALSE;
  177.       int        new_autoselectml = FALSE;
  178.       int        new_html = FALSE;
  179. --- 7307,7313 ----
  180.       static char_u *
  181.   check_clipboard_option()
  182.   {
  183. !     int        new_unnamed = 0;
  184.       int        new_autoselect = FALSE;
  185.       int        new_autoselectml = FALSE;
  186.       int        new_html = FALSE;
  187. ***************
  188. *** 7319,7327 ****
  189.       {
  190.       if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL))
  191.       {
  192. !         new_unnamed = TRUE;
  193.           p += 7;
  194.       }
  195.       else if (STRNCMP(p, "autoselect", 10) == 0
  196.                       && (p[10] == ',' || p[10] == NUL))
  197.       {
  198. --- 7319,7333 ----
  199.       {
  200.       if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL))
  201.       {
  202. !         new_unnamed |= CLIP_UNNAMED;
  203.           p += 7;
  204.       }
  205. +         else if (STRNCMP(p, "unnamedplus", 11) == 0
  206. +                         && (p[11] == ',' || p[11] == NUL))
  207. +     {
  208. +         new_unnamed |= CLIP_UNNAMED_PLUS;
  209. +         p += 11;
  210. +     }
  211.       else if (STRNCMP(p, "autoselect", 10) == 0
  212.                       && (p[10] == ',' || p[10] == NUL))
  213.       {
  214. *** ../vim-7.3.073/src/version.c    2010-12-02 17:09:48.000000000 +0100
  215. --- src/version.c    2010-12-02 21:34:40.000000000 +0100
  216. ***************
  217. *** 716,717 ****
  218. --- 716,719 ----
  219.   {   /* Add new patch number below this line */
  220. + /**/
  221. +     74,
  222.   /**/
  223.  
  224. -- 
  225. The budget process was invented by an alien race of sadistic beings who
  226. resemble large cats.
  227.                 (Scott Adams - The Dilbert principle)
  228.  
  229.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  230. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  231. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  232.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  233.