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.065 < prev    next >
Encoding:
Internet Message Format  |  2001-11-01  |  4.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.065
  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.065
  11. Problem:    When using ":normal" in 'indentexpr' it may use redo characters 
  12.             before its argument.  (Neil Bird)
  13. Solution:   Save and restore the stuff buffer in ex_normal().
  14. Files:      src/ex_docmd.c, src/getchar.c, src/globals.h, src/structs.h
  15.  
  16.  
  17. *** ../vim60.64/src/ex_docmd.c    Tue Oct 30 21:18:36 2001
  18. --- src/ex_docmd.c    Fri Nov  2 16:14:07 2001
  19. ***************
  20. *** 6805,6810 ****
  21. --- 6805,6811 ----
  22.       typebuf_T    saved_typebuf;
  23.       int        save_insertmode = p_im;
  24.       int        save_finish_op = finish_op;
  25. +     struct buffheader save_stuffbuff;
  26.   #ifdef FEAT_MBYTE
  27.       char_u    *arg = NULL;
  28.       int        l;
  29. ***************
  30. *** 6894,6899 ****
  31. --- 6895,6904 ----
  32.       saved_typebuf = typebuf;
  33.       if (alloc_typebuf() == OK)
  34.       {
  35. +     /* Also save the stuff buffer and make it empty. */
  36. +     save_stuffbuff = stuffbuff;
  37. +     stuffbuff.bh_first.b_next = NULL;
  38.       /*
  39.        * Repeat the :normal command for each line in the range.  When no
  40.        * range given, execute it just once, without positioning the cursor
  41. ***************
  42. *** 6927,6932 ****
  43. --- 6932,6939 ----
  44.           }
  45.       }
  46.       while (eap->addr_count > 0 && eap->line1 <= eap->line2 && !got_int);
  47. +     stuffbuff = save_stuffbuff;
  48.       }
  49.   
  50.       /* Might not return to the main loop when in an event handler. */
  51. *** ../vim60.64/src/getchar.c    Sun Oct 28 21:23:45 2001
  52. --- src/getchar.c    Fri Nov  2 16:23:29 2001
  53. ***************
  54. *** 38,66 ****
  55.    * Un-escaping is done by vgetc().
  56.    */
  57.   
  58. - /*
  59. -  * structure used to store one block of the stuff/redo/recording buffers
  60. -  */
  61. - struct buffblock
  62. - {
  63. -     struct buffblock    *b_next;    /* pointer to next buffblock */
  64. -     char_u        b_str[1];    /* contents (actually longer) */
  65. - };
  66.   #define MINIMAL_SIZE 20            /* minimal size for b_str */
  67.   
  68. - /*
  69. -  * header used for the stuff buffer and the redo buffer
  70. -  */
  71. - struct buffheader
  72. - {
  73. -     struct buffblock    bh_first;    /* first (dummy) block of list */
  74. -     struct buffblock    *bh_curr;    /* buffblock for appending */
  75. -     int            bh_index;    /* index for reading */
  76. -     int            bh_space;    /* space in bh_curr for appending */
  77. - };
  78. - static struct buffheader stuffbuff = {{NULL, {NUL}}, NULL, 0, 0};
  79.   static struct buffheader redobuff = {{NULL, {NUL}}, NULL, 0, 0};
  80.   static struct buffheader old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
  81.   #if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
  82. --- 38,45 ----
  83. *** ../vim60.64/src/globals.h    Sun Oct 28 21:23:45 2001
  84. --- src/globals.h    Fri Nov  2 16:07:27 2001
  85. ***************
  86. *** 693,702 ****
  87.   EXTERN int    readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
  88.   EXTERN int    recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
  89.   
  90.   EXTERN typebuf_T typebuf        /* typeahead buffer */
  91. ! # ifdef DO_INIT
  92.               = {NULL, NULL}
  93. ! # endif
  94.               ;
  95.   #ifdef FEAT_EX_EXTRA
  96.   EXTERN int    ex_normal_busy INIT(= 0); /* recursivenes of ex_normal() */
  97. --- 693,707 ----
  98.   EXTERN int    readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
  99.   EXTERN int    recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
  100.   
  101. + EXTERN struct buffheader stuffbuff    /* stuff buffer */
  102. + #ifdef DO_INIT
  103. +             = {{NULL, {NUL}}, NULL, 0, 0}
  104. + #endif
  105. +             ;
  106.   EXTERN typebuf_T typebuf        /* typeahead buffer */
  107. ! #ifdef DO_INIT
  108.               = {NULL, NULL}
  109. ! #endif
  110.               ;
  111.   #ifdef FEAT_EX_EXTRA
  112.   EXTERN int    ex_normal_busy INIT(= 0); /* recursivenes of ex_normal() */
  113. *** ../vim60.64/src/structs.h    Wed Oct 31 11:17:27 2001
  114. --- src/structs.h    Fri Nov  2 16:23:11 2001
  115. ***************
  116. *** 338,343 ****
  117. --- 338,363 ----
  118.   };
  119.   
  120.   /*
  121. +  * structure used to store one block of the stuff/redo/recording buffers
  122. +  */
  123. + struct buffblock
  124. + {
  125. +     struct buffblock    *b_next;    /* pointer to next buffblock */
  126. +     char_u        b_str[1];    /* contents (actually longer) */
  127. + };
  128. + /*
  129. +  * header used for the stuff buffer and the redo buffer
  130. +  */
  131. + struct buffheader
  132. + {
  133. +     struct buffblock    bh_first;    /* first (dummy) block of list */
  134. +     struct buffblock    *bh_curr;    /* buffblock for appending */
  135. +     int            bh_index;    /* index for reading */
  136. +     int            bh_space;    /* space in bh_curr for appending */
  137. + };
  138. + /*
  139.    * used for completion on the command line
  140.    */
  141.   typedef struct expand
  142. *** ../vim60.64/src/version.c    Fri Nov  2 16:20:26 2001
  143. --- src/version.c    Fri Nov  2 16:19:23 2001
  144. ***************
  145. *** 608,609 ****
  146. --- 608,611 ----
  147.   {   /* Add new patch number below this line */
  148. + /**/
  149. +     65,
  150.   /**/
  151.  
  152. -- 
  153. FIRST VILLAGER: We have found a witch.  May we burn her?
  154.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  155.  
  156.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  157. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  158.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  159.