4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
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
15 Files: src/ex_docmd.c, src/globals.h, src/normal.c, src/vim.h
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
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 ".").
28 * return FAIL if cmdline could not be executed, OK otherwise
38 + * Keep the first typed line. Clear it when more lines are typed.
40 + if (flags & DOCMD_KEEPLINE)
42 + vim_free(repeat_cmdline);
44 + repeat_cmdline = vim_strsave(next_cmdline);
46 + repeat_cmdline = NULL;
50 /* 3. Make a copy of the command so we can mess with it. */
51 *** ../vim-6.2.136/src/globals.h Tue Sep 16 14:15:52 2003
52 --- src/globals.h Tue Oct 28 19:49:48 2003
56 EXTERN int need_start_insertmode INIT(= FALSE);
57 /* start insert mode soon */
58 EXTERN char_u *last_cmdline INIT(= NULL); /* last command line (for ":) */
59 + EXTERN char_u *repeat_cmdline INIT(= NULL); /* command line for "." */
61 EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
63 *** ../vim-6.2.136/src/normal.c Sat Sep 27 19:36:47 2003
64 --- src/normal.c Tue Oct 28 20:03:49 2003
68 AppendToRedobuffLit(cap->searchbuf);
69 AppendToRedobuff(NL_STR);
71 + else if (cap->cmdchar == ':')
73 + /* do_cmdline() has stored the first typed line in
74 + * "repeat_cmdline". When several lines are typed repeating
75 + * won't be possible. */
76 + if (repeat_cmdline == NULL)
80 + AppendToRedobuffLit(repeat_cmdline);
81 + AppendToRedobuff(NL_STR);
82 + vim_free(repeat_cmdline);
83 + repeat_cmdline = NULL;
93 /* get a command line and execute it */
94 ! do_cmdline(NULL, getexline, NULL, 0);
96 /* If 'insertmode' changed, enter or exit Insert mode */
101 /* get a command line and execute it */
102 ! do_cmdline(NULL, getexline, NULL,
103 ! cap->oap->op_type != OP_NOP ? DOCMD_KEEPLINE : 0);
105 /* If 'insertmode' changed, enter or exit Insert mode */
106 if (p_im != old_p_im)
107 *** ../vim-6.2.136/src/vim.h Mon Oct 13 22:21:06 2003
108 --- src/vim.h Wed Oct 29 12:51:00 2003
112 #define DOCMD_REPEAT 0x04 /* repeat exec. until getline() returns NULL */
113 #define DOCMD_KEYTYPED 0x08 /* don't reset KeyTyped */
114 #define DOCMD_EXCRESET 0x10 /* reset exception environment (for debugging)*/
115 + #define DOCMD_KEEPLINE 0x20 /* keep typed line for repeating with "." */
117 /* flags for beginline() */
118 #define BL_WHITE 1 /* cursor on first non-white in the line */
119 *** ../vim-6.2.136/src/version.c Wed Oct 29 14:29:15 2003
120 --- src/version.c Wed Oct 29 14:31:43 2003
124 { /* Add new patch number below this line */
130 TALL KNIGHT: When you have found the shrubbery, then you must cut down the
131 mightiest tree in the forest ... with a herring.
132 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
134 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
135 /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
136 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
137 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///