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.221 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  7.9 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.221
  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.221
  11. Problem:    Text from the clipboard is sometimes handled as linewise, but not
  12.             consistently.
  13. Solution:   Assume the text is linewise when it ends in a CR or NL.
  14. Files:      src/gui_gtk_x11.c, src/gui_mac.c, src/ops.c, src/os_msdos.c,
  15.             src/os_mswin.c, src/os_qnx.c, src/ui.c
  16.  
  17.  
  18. *** ../mercurial/vim73/src/gui_gtk_x11.c    2011-02-25 17:10:22.000000000 +0100
  19. --- src/gui_gtk_x11.c    2011-06-19 00:58:31.000000000 +0200
  20. ***************
  21. *** 1173,1179 ****
  22.       char_u        *tmpbuf = NULL;
  23.       guchar        *tmpbuf_utf8 = NULL;
  24.       int            len;
  25. !     int            motion_type;
  26.   
  27.       if (data->selection == clip_plus.gtk_sel_atom)
  28.       cbd = &clip_plus;
  29. --- 1173,1179 ----
  30.       char_u        *tmpbuf = NULL;
  31.       guchar        *tmpbuf_utf8 = NULL;
  32.       int            len;
  33. !     int            motion_type = MAUTO;
  34.   
  35.       if (data->selection == clip_plus.gtk_sel_atom)
  36.       cbd = &clip_plus;
  37. ***************
  38. *** 1182,1188 ****
  39.   
  40.       text = (char_u *)data->data;
  41.       len  = data->length;
  42. -     motion_type = MCHAR;
  43.   
  44.       if (text == NULL || len <= 0)
  45.       {
  46. --- 1182,1187 ----
  47. *** ../mercurial/vim73/src/gui_mac.c    2011-06-12 20:33:30.000000000 +0200
  48. --- src/gui_mac.c    2011-06-19 00:59:07.000000000 +0200
  49. ***************
  50. *** 4671,4677 ****
  51.       if (flavor)
  52.       type = **textOfClip;
  53.       else
  54. !     type = (strchr(*textOfClip, '\r') != NULL) ? MLINE : MCHAR;
  55.   
  56.       tempclip = lalloc(scrapSize + 1, TRUE);
  57.       mch_memmove(tempclip, *textOfClip + flavor, scrapSize);
  58. --- 4671,4677 ----
  59.       if (flavor)
  60.       type = **textOfClip;
  61.       else
  62. !     type = MAUTO;
  63.   
  64.       tempclip = lalloc(scrapSize + 1, TRUE);
  65.       mch_memmove(tempclip, *textOfClip + flavor, scrapSize);
  66. *** ../mercurial/vim73/src/ops.c    2011-04-01 16:28:33.000000000 +0200
  67. --- src/ops.c    2011-06-19 00:59:39.000000000 +0200
  68. ***************
  69. *** 5733,5739 ****
  70.       }
  71.   }
  72.   
  73. ! /* Convert from the GUI selection string into the '*'/'+' register */
  74.       void
  75.   clip_yank_selection(type, str, len, cbd)
  76.       int        type;
  77. --- 5733,5741 ----
  78.       }
  79.   }
  80.   
  81. ! /*
  82. !  * Convert from the GUI selection string into the '*'/'+' register.
  83. !  */
  84.       void
  85.   clip_yank_selection(type, str, len, cbd)
  86.       int        type;
  87. ***************
  88. *** 6090,6098 ****
  89.       if (yank_type == MBLOCK)
  90.       yank_type = MAUTO;
  91.   #endif
  92. -     if (yank_type == MAUTO)
  93. -     yank_type = ((len > 0 && (str[len - 1] == '\n' || str[len - 1] == '\r'))
  94. -                                  ? MLINE : MCHAR);
  95.       str_to_reg(y_current, yank_type, str, len, block_len);
  96.   
  97.   # ifdef FEAT_CLIPBOARD
  98. --- 6092,6097 ----
  99. ***************
  100. *** 6113,6125 ****
  101.    * is appended.
  102.    */
  103.       static void
  104. ! str_to_reg(y_ptr, type, str, len, blocklen)
  105.       struct yankreg    *y_ptr;        /* pointer to yank register */
  106. !     int            type;        /* MCHAR, MLINE or MBLOCK */
  107.       char_u        *str;        /* string to put in register */
  108.       long        len;        /* length of string */
  109.       long        blocklen;    /* width of Visual block */
  110.   {
  111.       int        lnum;
  112.       long    start;
  113.       long    i;
  114. --- 6112,6125 ----
  115.    * is appended.
  116.    */
  117.       static void
  118. ! str_to_reg(y_ptr, yank_type, str, len, blocklen)
  119.       struct yankreg    *y_ptr;        /* pointer to yank register */
  120. !     int            yank_type;    /* MCHAR, MLINE, MBLOCK, MAUTO */
  121.       char_u        *str;        /* string to put in register */
  122.       long        len;        /* length of string */
  123.       long        blocklen;    /* width of Visual block */
  124.   {
  125. +     int        type;            /* MCHAR, MLINE or MBLOCK */
  126.       int        lnum;
  127.       long    start;
  128.       long    i;
  129. ***************
  130. *** 6136,6141 ****
  131. --- 6136,6147 ----
  132.       if (y_ptr->y_array == NULL)        /* NULL means empty register */
  133.       y_ptr->y_size = 0;
  134.   
  135. +     if (yank_type == MAUTO)
  136. +     type = ((len > 0 && (str[len - 1] == NL || str[len - 1] == CAR))
  137. +                                  ? MLINE : MCHAR);
  138. +     else
  139. +     type = yank_type;
  140.       /*
  141.        * Count the number of lines within the string
  142.        */
  143. *** ../mercurial/vim73/src/os_msdos.c    2010-12-17 18:06:00.000000000 +0100
  144. --- src/os_msdos.c    2011-06-19 01:00:56.000000000 +0200
  145. ***************
  146. *** 2232,2238 ****
  147.       void
  148.   clip_mch_request_selection(VimClipboard *cbd)
  149.   {
  150. !     int        type = MCHAR;
  151.       char_u    *pAllocated = NULL;
  152.       char_u    *pClipText = NULL;
  153.       int        clip_data_format = 0;
  154. --- 2232,2238 ----
  155.       void
  156.   clip_mch_request_selection(VimClipboard *cbd)
  157.   {
  158. !     int        type = MAUTO;
  159.       char_u    *pAllocated = NULL;
  160.       char_u    *pClipText = NULL;
  161.       int        clip_data_format = 0;
  162. ***************
  163. *** 2280,2293 ****
  164.       {
  165.           clip_data_format = CF_TEXT;
  166.           pClipText = pAllocated;
  167. -         type = (vim_strchr((char*)pClipText, '\r') != NULL) ? MLINE : MCHAR;
  168.       }
  169.   
  170.       else if ((pAllocated = Win16GetClipboardData(CF_OEMTEXT)) != NULL)
  171.       {
  172.           clip_data_format = CF_OEMTEXT;
  173.           pClipText = pAllocated;
  174. -         type = (vim_strchr((char*)pClipText, '\r') != NULL) ? MLINE : MCHAR;
  175.       }
  176.   
  177.       /* Did we get anything? */
  178. --- 2280,2291 ----
  179. *** ../mercurial/vim73/src/os_mswin.c    2011-01-17 20:08:04.000000000 +0100
  180. --- src/os_mswin.c    2011-06-19 01:01:51.000000000 +0200
  181. ***************
  182. *** 1410,1418 ****
  183.       {
  184.       char_u *temp_clipboard;
  185.   
  186. !     /* If the type is not known guess it. */
  187.       if (metadata.type == -1)
  188. !         metadata.type = (vim_strchr(str, '\n') == NULL) ? MCHAR : MLINE;
  189.   
  190.       /* Translate <CR><NL> into <NL>. */
  191.       temp_clipboard = crnl_to_nl(str, &str_size);
  192. --- 1410,1418 ----
  193.       {
  194.       char_u *temp_clipboard;
  195.   
  196. !     /* If the type is not known detect it. */
  197.       if (metadata.type == -1)
  198. !         metadata.type = MAUTO;
  199.   
  200.       /* Translate <CR><NL> into <NL>. */
  201.       temp_clipboard = crnl_to_nl(str, &str_size);
  202. *** ../mercurial/vim73/src/os_qnx.c    2010-05-15 21:22:11.000000000 +0200
  203. --- src/os_qnx.c    2011-06-19 01:02:26.000000000 +0200
  204. ***************
  205. *** 93,99 ****
  206.           clip_length  = clip_header->length - 1;
  207.   
  208.           if( clip_text != NULL && is_type_set == FALSE )
  209. !         type = (strchr( clip_text, '\r' ) != NULL) ? MLINE : MCHAR;
  210.       }
  211.   
  212.       if( (clip_text != NULL) && (clip_length > 0) )
  213. --- 93,99 ----
  214.           clip_length  = clip_header->length - 1;
  215.   
  216.           if( clip_text != NULL && is_type_set == FALSE )
  217. !         type = MAUTO;
  218.       }
  219.   
  220.       if( (clip_text != NULL) && (clip_length > 0) )
  221. *** ../mercurial/vim73/src/ui.c    2010-09-21 22:09:28.000000000 +0200
  222. --- src/ui.c    2011-06-19 01:03:31.000000000 +0200
  223. ***************
  224. *** 1609,1615 ****
  225.   
  226.   #if defined(FEAT_HANGULIN) || defined(PROTO)
  227.       void
  228. ! push_raw_key (s, len)
  229.       char_u  *s;
  230.       int        len;
  231.   {
  232. --- 1609,1615 ----
  233.   
  234.   #if defined(FEAT_HANGULIN) || defined(PROTO)
  235.       void
  236. ! push_raw_key(s, len)
  237.       char_u  *s;
  238.       int        len;
  239.   {
  240. ***************
  241. *** 2016,2022 ****
  242.       long_u    *length;
  243.       int        *format;
  244.   {
  245. !     int        motion_type;
  246.       long_u    len;
  247.       char_u    *p;
  248.       char    **text_list = NULL;
  249. --- 2016,2022 ----
  250.       long_u    *length;
  251.       int        *format;
  252.   {
  253. !     int        motion_type = MAUTO;
  254.       long_u    len;
  255.       char_u    *p;
  256.       char    **text_list = NULL;
  257. ***************
  258. *** 2036,2042 ****
  259.       *(int *)success = FALSE;
  260.       return;
  261.       }
  262. -     motion_type = MCHAR;
  263.       p = (char_u *)value;
  264.       len = *length;
  265.       if (*type == vim_atom)
  266. --- 2036,2041 ----
  267. *** ../vim-7.3.220/src/version.c    2011-06-19 00:27:46.000000000 +0200
  268. --- src/version.c    2011-06-19 01:03:59.000000000 +0200
  269. ***************
  270. *** 711,712 ****
  271. --- 711,714 ----
  272.   {   /* Add new patch number below this line */
  273. + /**/
  274. +     221,
  275.   /**/
  276.  
  277. -- 
  278. hundred-and-one symptoms of being an internet addict:
  279. 190. You quickly hand over your wallet, leather jacket, and car keys
  280.      during a mugging, then proceed to beat the crap out of your
  281.      assailant when he asks for your laptop.
  282.  
  283.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  284. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  285. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  286.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  287.