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

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.3.014
  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.014
  11. Problem:    Ending a line in a backslash inside an ":append" or ":insert" 
  12.             command in Ex mode doesn't work properly. (Ray Frush)
  13. Solution:   Halve the number of backslashes, only insert a NUL after an odd 
  14.             number of backslashes.
  15. Files:      src/ex_getln.c
  16.  
  17.  
  18. *** ../vim-7.3.013/src/ex_getln.c    2010-09-21 16:56:29.000000000 +0200
  19. --- src/ex_getln.c    2010-09-29 15:47:56.000000000 +0200
  20. ***************
  21. *** 2342,2356 ****
  22.       windgoto(msg_row, msg_col);
  23.       pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
  24.   
  25. !     /* we are done when a NL is entered, but not when it comes after a
  26. !      * backslash */
  27. !     if (line_ga.ga_len > 0 && pend[-1] == '\n'
  28. !         && (line_ga.ga_len <= 1 || pend[-2] != '\\'))
  29. !     {
  30. !         --line_ga.ga_len;
  31. !         --pend;
  32. !         *pend = NUL;
  33. !         break;
  34.       }
  35.       }
  36.   
  37. --- 2342,2372 ----
  38.       windgoto(msg_row, msg_col);
  39.       pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
  40.   
  41. !     /* We are done when a NL is entered, but not when it comes after an
  42. !      * odd number of backslashes, that results in a NUL. */
  43. !     if (line_ga.ga_len > 0 && pend[-1] == '\n')
  44. !     {
  45. !         int bcount = 0;
  46. !         while (line_ga.ga_len - 2 >= bcount && pend[-2 - bcount] == '\\')
  47. !         ++bcount;
  48. !         if (bcount > 0)
  49. !         {
  50. !         /* Halve the number of backslashes: "\NL" -> "NUL", "\\NL" ->
  51. !          * "\NL", etc. */
  52. !         line_ga.ga_len -= (bcount + 1) / 2;
  53. !         pend -= (bcount + 1) / 2;
  54. !         pend[-1] = '\n';
  55. !         }
  56. !         if ((bcount & 1) == 0)
  57. !         {
  58. !         --line_ga.ga_len;
  59. !         --pend;
  60. !         *pend = NUL;
  61. !         break;
  62. !         }
  63.       }
  64.       }
  65.   
  66. *** ../vim-7.3.013/src/version.c    2010-09-29 13:02:48.000000000 +0200
  67. --- src/version.c    2010-09-29 15:45:57.000000000 +0200
  68. ***************
  69. *** 716,717 ****
  70. --- 716,719 ----
  71.   {   /* Add new patch number below this line */
  72. + /**/
  73. +     14,
  74.   /**/
  75.  
  76. -- 
  77. hundred-and-one symptoms of being an internet addict:
  78. 224. You set up your own Web page. You set up a Web page for each
  79.      of your kids... and your pets.
  80.  
  81.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  82. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  83. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  84.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  85.