]>
Commit | Line | Data |
---|---|---|
eb0ac1ae AG |
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 | + /* | |
38 | + * Keep the first typed line. Clear it when more lines are typed. | |
39 | + */ | |
40 | + if (flags & DOCMD_KEEPLINE) | |
41 | + { | |
42 | + vim_free(repeat_cmdline); | |
43 | + if (count == 0) | |
44 | + repeat_cmdline = vim_strsave(next_cmdline); | |
45 | + else | |
46 | + repeat_cmdline = NULL; | |
47 | + } | |
48 | } | |
49 | ||
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 | |
53 | *************** | |
54 | *** 872,877 **** | |
55 | --- 872,878 ---- | |
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 "." */ | |
60 | #ifdef FEAT_CMDHIST | |
61 | EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */ | |
62 | #endif | |
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 | |
65 | *************** | |
66 | *** 1355,1360 **** | |
67 | --- 1355,1375 ---- | |
68 | AppendToRedobuffLit(cap->searchbuf); | |
69 | AppendToRedobuff(NL_STR); | |
70 | } | |
71 | + else if (cap->cmdchar == ':') | |
72 | + { | |
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) | |
77 | + ResetRedobuff(); | |
78 | + else | |
79 | + { | |
80 | + AppendToRedobuffLit(repeat_cmdline); | |
81 | + AppendToRedobuff(NL_STR); | |
82 | + vim_free(repeat_cmdline); | |
83 | + repeat_cmdline = NULL; | |
84 | + } | |
85 | + } | |
86 | } | |
87 | ||
88 | #ifdef FEAT_VISUAL | |
89 | *************** | |
90 | *** 4559,4565 **** | |
91 | old_p_im = p_im; | |
92 | ||
93 | /* get a command line and execute it */ | |
94 | ! do_cmdline(NULL, getexline, NULL, 0); | |
95 | ||
96 | /* If 'insertmode' changed, enter or exit Insert mode */ | |
97 | if (p_im != old_p_im) | |
98 | --- 4574,4581 ---- | |
99 | old_p_im = p_im; | |
100 | ||
101 | /* get a command line and execute it */ | |
102 | ! do_cmdline(NULL, getexline, NULL, | |
103 | ! cap->oap->op_type != OP_NOP ? DOCMD_KEEPLINE : 0); | |
104 | ||
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 | |
109 | *************** | |
110 | *** 811,816 **** | |
111 | --- 811,817 ---- | |
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 "." */ | |
116 | ||
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 | |
121 | *************** | |
122 | *** 639,640 **** | |
123 | --- 639,642 ---- | |
124 | { /* Add new patch number below this line */ | |
125 | + /**/ | |
126 | + 137, | |
127 | /**/ | |
128 | ||
129 | -- | |
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 | |
133 | ||
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 /// |