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.2.528 < prev    next >
Encoding:
Internet Message Format  |  2004-05-04  |  5.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.528
  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.2.528
  11. Problem:    NetBeans: Changes of the "~" command are not reported.
  12. Solution:   Call netbeans_inserted() after performing "~". (Gordon Prieur)
  13.         Also change NetBeans debugging to append to the log file.
  14.         Also fix that "~" in Visual block mode changes too much if there
  15.         are multi-byte characters.
  16. Files:        src/nbdebug.c, src/normal.c, src/ops.c
  17.  
  18.  
  19. *** ../vim-6.2.527/src/nbdebug.c    Sun Oct 12 16:42:14 2003
  20. --- src/nbdebug.c    Wed Apr 14 19:55:02 2004
  21. ***************
  22. *** 86,92 ****
  23.       if (log_var && (file = getenv(log_var)) != NULL) {
  24.           time_t now;
  25.   
  26. !         nb_debug = fopen(file, "w");
  27.           time(&now);
  28.           fprintf(nb_debug, "%s", asctime(localtime(&now)));
  29.           if (level_var && (cp = getenv(level_var)) != NULL) {
  30. --- 86,92 ----
  31.       if (log_var && (file = getenv(log_var)) != NULL) {
  32.           time_t now;
  33.   
  34. !         nb_debug = fopen(file, "a");
  35.           time(&now);
  36.           fprintf(nb_debug, "%s", asctime(localtime(&now)));
  37.           if (level_var && (cp = getenv(level_var)) != NULL) {
  38. *** ../vim-6.2.527/src/normal.c    Mon Apr 19 20:26:43 2004
  39. --- src/normal.c    Mon Apr 26 15:19:26 2004
  40. ***************
  41. *** 6460,6465 ****
  42. --- 6460,6470 ----
  43.       long    n;
  44.       pos_T    startpos;
  45.       int        did_change = 0;
  46. + #ifdef FEAT_NETBEANS_INTG
  47. +     pos_T    pos;
  48. +     char_u    *ptr;
  49. +     int        count;
  50. + #endif
  51.   
  52.       if (checkclearopq(cap->oap))
  53.       return;
  54. ***************
  55. *** 6476,6481 ****
  56. --- 6481,6489 ----
  57.       return;
  58.   
  59.       startpos = curwin->w_cursor;
  60. + #ifdef FEAT_NETBEANS_INTG
  61. +     pos = startpos;
  62. + #endif
  63.       for (n = cap->count1; n > 0; --n)
  64.       {
  65.       did_change |= swapchar(cap->oap->op_type, &curwin->w_cursor);
  66. ***************
  67. *** 6485,6490 ****
  68. --- 6493,6512 ----
  69.           if (vim_strchr(p_ww, '~') != NULL
  70.               && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
  71.           {
  72. + #ifdef FEAT_NETBEANS_INTG
  73. +         if (usingNetbeans)
  74. +         {
  75. +             if (did_change)
  76. +             {
  77. +             ptr = ml_get(pos.lnum);
  78. +             count = STRLEN(ptr) - pos.col;
  79. +             netbeans_inserted(curbuf, pos.lnum, pos.col,
  80. +                          count, &ptr[pos.col], count);
  81. +             }
  82. +             pos.col = 0;
  83. +             pos.lnum++;
  84. +         }
  85. + #endif
  86.           ++curwin->w_cursor.lnum;
  87.           curwin->w_cursor.col = 0;
  88.           if (n > 1)
  89. ***************
  90. *** 6498,6503 ****
  91. --- 6520,6535 ----
  92.           break;
  93.       }
  94.       }
  95. + #ifdef FEAT_NETBEANS_INTG
  96. +     if (did_change && usingNetbeans)
  97. +     {
  98. +     ptr = ml_get(pos.lnum);
  99. +     count = curwin->w_cursor.col - pos.col;
  100. +     netbeans_inserted(curbuf, pos.lnum, pos.col,
  101. +                          count, &ptr[pos.col], count);
  102. +     }
  103. + #endif
  104.   
  105.       check_cursor();
  106.       curwin->w_set_curswant = TRUE;
  107. *** ../vim-6.2.527/src/ops.c    Fri Apr 30 19:42:02 2004
  108. --- src/ops.c    Wed May  5 10:34:02 2004
  109. ***************
  110. *** 2148,2155 ****
  111. --- 2148,2159 ----
  112.       pos_T        pos;
  113.   #ifdef FEAT_VISUAL
  114.       struct block_def    bd;
  115. +     int            done;
  116.   #endif
  117.       int            did_change = 0;
  118. + #ifdef FEAT_MBYTE
  119. +     colnr_T        col;
  120. + #endif
  121.   
  122.       if (u_save((linenr_T)(oap->start.lnum - 1),
  123.                          (linenr_T)(oap->end.lnum + 1)) == FAIL)
  124. ***************
  125. *** 2163,2174 ****
  126.       {
  127.           block_prep(oap, &bd, pos.lnum, FALSE);
  128.           pos.col = bd.textcol;
  129. !         while (--bd.textlen >= 0)
  130.           {
  131.           did_change |= swapchar(oap->op_type, &pos);
  132.           if (inc(&pos) == -1)        /* at end of file */
  133.               break;
  134.           }
  135.       }
  136.       if (did_change)
  137.           changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
  138. --- 2167,2195 ----
  139.       {
  140.           block_prep(oap, &bd, pos.lnum, FALSE);
  141.           pos.col = bd.textcol;
  142. !         for (done = 0; done < bd.textlen; ++done)
  143.           {
  144.           did_change |= swapchar(oap->op_type, &pos);
  145. + # ifdef FEAT_MBYTE
  146. +         col = pos.col + 1;
  147. + # endif
  148.           if (inc(&pos) == -1)        /* at end of file */
  149.               break;
  150. + # ifdef FEAT_MBYTE
  151. +         if (pos.col > col)
  152. +             /* Count extra bytes of a multi-byte character. */
  153. +             done += pos.col - col;
  154. + # endif
  155.           }
  156. + # ifdef FEAT_NETBEANS_INTG
  157. +         if (usingNetbeans && did_change)
  158. +         {
  159. +         char_u *ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
  160. +         netbeans_inserted(curbuf, pos.lnum, bd.textcol,
  161. +                     bd.textlen, &ptr[bd.textcol], bd.textlen);
  162. +         }
  163. + # endif
  164.       }
  165.       if (did_change)
  166.           changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
  167. ***************
  168. *** 2194,2201 ****
  169. --- 2215,2246 ----
  170.           break;
  171.       }
  172.       if (did_change)
  173. +     {
  174.           changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
  175.                                         0L);
  176. + #ifdef FEAT_NETBEANS_INTG
  177. +         if (usingNetbeans && did_change)
  178. +         {
  179. +         char_u *ptr;
  180. +         int count;
  181. +         pos = oap->start;
  182. +         while (pos.lnum < oap->end.lnum)
  183. +         {
  184. +             ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
  185. +             count = STRLEN(ptr) - pos.col;
  186. +             netbeans_inserted(curbuf, pos.lnum, pos.col,
  187. +                          count, &ptr[pos.col], count);
  188. +             pos.col = 0;
  189. +             pos.lnum++;
  190. +         }
  191. +         ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
  192. +         count = oap->end.col - pos.col + 1;
  193. +         netbeans_inserted(curbuf, pos.lnum, pos.col,
  194. +                          count, &ptr[pos.col], count);
  195. +         }
  196. + #endif
  197. +     }
  198.       }
  199.   
  200.   #ifdef FEAT_VISUAL
  201. *** ../vim-6.2.527/src/version.c    Wed May  5 11:17:53 2004
  202. --- src/version.c    Wed May  5 11:47:08 2004
  203. ***************
  204. *** 639,640 ****
  205. --- 642,645 ----
  206.   {   /* Add new patch number below this line */
  207. + /**/
  208. +     528,
  209.   /**/
  210.  
  211. -- 
  212. Nobody will ever need more than 640 kB RAM.
  213.         -- Bill Gates, 1983
  214. Windows 98 requires 16 MB RAM.
  215.         -- Bill Gates, 1999
  216. Logical conclusion: Nobody will ever need Windows 98.
  217.  
  218.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  219. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  220. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  221.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  222.