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.137 < prev    next >
Encoding:
Internet Message Format  |  2003-10-28  |  4.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.137
  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.137
  11. Problem:    "d:cmd<CR>" cannot be repeated with ".".  Breaks repeating "d%"
  12.         when using the matchit plugin.
  13. Solution:   Store the command to be repeated.  This is restricted to
  14.         single-line commands.
  15. Files:        src/ex_docmd.c, src/globals.h, src/normal.c, src/vim.h
  16.  
  17.  
  18. *** ../vim-6.2.136/src/ex_docmd.c    Sun Oct 26 20:12:53 2003
  19. --- src/ex_docmd.c    Tue Oct 28 19:50:06 2003
  20. ***************
  21. *** 570,575 ****
  22. --- 570,576 ----
  23.    * DOCMD_REPEAT   - Repeat execution until getline() returns NULL.
  24.    * DOCMD_KEYTYPED - Don't reset KeyTyped.
  25.    * DOCMD_EXCRESET - Reset the exception environment (used for debugging).
  26. +  * DOCMD_KEEPLINE - Store first typed line (for repeating with ".").
  27.    *
  28.    * return FAIL if cmdline could not be executed, OK otherwise
  29.    */
  30. ***************
  31. *** 817,822 ****
  32. --- 818,835 ----
  33.           retval = FAIL;
  34.           break;
  35.           }
  36. +         /*
  37. +          * Keep the first typed line.  Clear it when more lines are typed.
  38. +          */
  39. +         if (flags & DOCMD_KEEPLINE)
  40. +         {
  41. +         vim_free(repeat_cmdline);
  42. +         if (count == 0)
  43. +             repeat_cmdline = vim_strsave(next_cmdline);
  44. +         else
  45. +             repeat_cmdline = NULL;
  46. +         }
  47.       }
  48.   
  49.       /* 3. Make a copy of the command so we can mess with it. */
  50. *** ../vim-6.2.136/src/globals.h    Tue Sep 16 14:15:52 2003
  51. --- src/globals.h    Tue Oct 28 19:49:48 2003
  52. ***************
  53. *** 872,877 ****
  54. --- 872,878 ----
  55.   EXTERN int    need_start_insertmode INIT(= FALSE);
  56.                           /* start insert mode soon */
  57.   EXTERN char_u    *last_cmdline INIT(= NULL); /* last command line (for ":) */
  58. + EXTERN char_u    *repeat_cmdline INIT(= NULL); /* command line for "." */
  59.   #ifdef FEAT_CMDHIST
  60.   EXTERN char_u    *new_last_cmdline INIT(= NULL);    /* new value for last_cmdline */
  61.   #endif
  62. *** ../vim-6.2.136/src/normal.c    Sat Sep 27 19:36:47 2003
  63. --- src/normal.c    Tue Oct 28 20:03:49 2003
  64. ***************
  65. *** 1355,1360 ****
  66. --- 1355,1375 ----
  67.               AppendToRedobuffLit(cap->searchbuf);
  68.           AppendToRedobuff(NL_STR);
  69.           }
  70. +         else if (cap->cmdchar == ':')
  71. +         {
  72. +         /* do_cmdline() has stored the first typed line in
  73. +          * "repeat_cmdline".  When several lines are typed repeating
  74. +          * won't be possible. */
  75. +         if (repeat_cmdline == NULL)
  76. +             ResetRedobuff();
  77. +         else
  78. +         {
  79. +             AppendToRedobuffLit(repeat_cmdline);
  80. +             AppendToRedobuff(NL_STR);
  81. +             vim_free(repeat_cmdline);
  82. +             repeat_cmdline = NULL;
  83. +         }
  84. +         }
  85.       }
  86.   
  87.   #ifdef FEAT_VISUAL
  88. ***************
  89. *** 4559,4565 ****
  90.       old_p_im = p_im;
  91.   
  92.       /* get a command line and execute it */
  93. !     do_cmdline(NULL, getexline, NULL, 0);
  94.   
  95.       /* If 'insertmode' changed, enter or exit Insert mode */
  96.       if (p_im != old_p_im)
  97. --- 4574,4581 ----
  98.       old_p_im = p_im;
  99.   
  100.       /* get a command line and execute it */
  101. !     do_cmdline(NULL, getexline, NULL,
  102. !                 cap->oap->op_type != OP_NOP ? DOCMD_KEEPLINE : 0);
  103.   
  104.       /* If 'insertmode' changed, enter or exit Insert mode */
  105.       if (p_im != old_p_im)
  106. *** ../vim-6.2.136/src/vim.h    Mon Oct 13 22:21:06 2003
  107. --- src/vim.h    Wed Oct 29 12:51:00 2003
  108. ***************
  109. *** 811,816 ****
  110. --- 811,817 ----
  111.   #define DOCMD_REPEAT    0x04    /* repeat exec. until getline() returns NULL */
  112.   #define DOCMD_KEYTYPED    0x08    /* don't reset KeyTyped */
  113.   #define DOCMD_EXCRESET    0x10    /* reset exception environment (for debugging)*/
  114. + #define DOCMD_KEEPLINE  0x20    /* keep typed line for repeating with "." */
  115.   
  116.   /* flags for beginline() */
  117.   #define BL_WHITE    1    /* cursor on first non-white in the line */
  118. *** ../vim-6.2.136/src/version.c    Wed Oct 29 14:29:15 2003
  119. --- src/version.c    Wed Oct 29 14:31:43 2003
  120. ***************
  121. *** 639,640 ****
  122. --- 639,642 ----
  123.   {   /* Add new patch number below this line */
  124. + /**/
  125. +     137,
  126.   /**/
  127.  
  128. -- 
  129. TALL KNIGHT: When you have found the shrubbery, then you must cut down the
  130.              mightiest tree in the forest ... with a herring.
  131.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  132.  
  133.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  134. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  135. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  136.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  137.