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 / 6.0.177 < prev    next >
Encoding:
Internet Message Format  |  2002-02-03  |  3.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.177
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.177
  11. Problem:    When 'commentstring' is empty and 'foldmethod' is "marker", "zf"
  12.         doesn't work. (Thomas S. Urban)
  13. Solution:   Add the marker even when 'commentstring' is empty.
  14. Files:        src/fold.c, src/normal.c
  15.  
  16.  
  17. *** ../vim60.176/src/fold.c    Mon Oct 29 09:34:01 2001
  18. --- src/fold.c    Mon Feb  4 17:19:15 2002
  19. ***************
  20. *** 547,554 ****
  21.   foldManualAllowed(create)
  22.       int        create;
  23.   {
  24. !     if (foldmethodIsManual(curwin)
  25. !            || (foldmethodIsMarker(curwin) && *curbuf->b_p_cms != NUL))
  26.       return TRUE;
  27.       if (create)
  28.       EMSG(_("E350: Cannot create fold with current 'foldmethod'"));
  29. --- 547,553 ----
  30.   foldManualAllowed(create)
  31.       int        create;
  32.   {
  33. !     if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin))
  34.       return TRUE;
  35.       if (create)
  36.       EMSG(_("E350: Cannot create fold with current 'foldmethod'"));
  37. ***************
  38. *** 1696,1706 ****
  39.       EMSG(_(e_modifiable));
  40.       return;
  41.       }
  42. -     if (*curbuf->b_p_cms == NUL)
  43. -     {
  44. -     EMSG(_("E221: 'commentstring' is empty"));
  45. -     return;
  46. -     }
  47.       parseMarker(curwin);
  48.   
  49.       foldAddMarker(start, curwin->w_p_fmr, foldstartmarkerlen);
  50. --- 1695,1700 ----
  51. ***************
  52. *** 1730,1745 ****
  53.       /* Allocate a new line: old-line + 'cms'-start + marker + 'cms'-end */
  54.       line = ml_get(lnum);
  55.       line_len = (int)STRLEN(line);
  56. -     newline = alloc((unsigned)(line_len + markerlen + STRLEN(cms) - 1));
  57. -     if (newline == NULL)
  58. -     return;
  59.   
  60.       if (u_save(lnum - 1, lnum + 1) == OK)
  61.       {
  62.       STRCPY(newline, line);
  63. !     STRCPY(newline + line_len, cms);
  64. !     STRNCPY(newline + line_len + (p - cms), marker, markerlen);
  65. !     STRCPY(newline + line_len + (p - cms) + markerlen, p + 2);
  66.   
  67.       ml_replace(lnum, newline, FALSE);
  68.       }
  69. --- 1724,1747 ----
  70.       /* Allocate a new line: old-line + 'cms'-start + marker + 'cms'-end */
  71.       line = ml_get(lnum);
  72.       line_len = (int)STRLEN(line);
  73.   
  74.       if (u_save(lnum - 1, lnum + 1) == OK)
  75.       {
  76. +     newline = alloc((unsigned)(line_len + markerlen + STRLEN(cms) + 1));
  77. +     if (newline == NULL)
  78. +         return;
  79.       STRCPY(newline, line);
  80. !     if (p == NULL)
  81. !     {
  82. !         STRNCPY(newline + line_len, marker, markerlen);
  83. !         newline[line_len + markerlen] = NUL;
  84. !     }
  85. !     else
  86. !     {
  87. !         STRCPY(newline + line_len, cms);
  88. !         STRNCPY(newline + line_len + (p - cms), marker, markerlen);
  89. !         STRCPY(newline + line_len + (p - cms) + markerlen, p + 2);
  90. !     }
  91.   
  92.       ml_replace(lnum, newline, FALSE);
  93.       }
  94. ***************
  95. *** 3084,3090 ****
  96.       return OK;
  97.   }
  98.   
  99. ! /* put_folds_recurse() {{{2 */
  100.   /*
  101.    * Write commands to "fd" to open and close manually opened/closed folds.
  102.    * Returns FAIL when writing failed.
  103. --- 3086,3092 ----
  104.       return OK;
  105.   }
  106.   
  107. ! /* put_foldopen_recurse() {{{2 */
  108.   /*
  109.    * Write commands to "fd" to open and close manually opened/closed folds.
  110.    * Returns FAIL when writing failed.
  111. *** ../vim60.176/src/version.c    Mon Feb  4 17:08:29 2002
  112. --- src/version.c    Mon Feb  4 17:25:21 2002
  113. ***************
  114. *** 608,609 ****
  115. --- 608,611 ----
  116.   {   /* Add new patch number below this line */
  117. + /**/
  118. +     177,
  119.   /**/
  120.  
  121. -- 
  122. hundred-and-one symptoms of being an internet addict:
  123. 200. You really believe in the concept of a "paperless" office.
  124.  
  125.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  126. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  127.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  128.