]> git.pld-linux.org Git - packages/vim.git/blob - 7.0.177
- new
[packages/vim.git] / 7.0.177
1 To: vim-dev@vim.org
2 Subject: patch 7.0.177
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 7.0.177
11 Problem:    When the press-enter prompt gets a character from a non-remappable
12             mapping, it's put back in the typeahead buffer as remappable,
13             which may cause an endless loop.
14 Solution:   Restore the non-remappable flag and the silent flag when putting a
15             char back in the typeahead buffer.
16 Files:      src/getchar.c, src/message.c, src/normal.c
17
18
19 *** ../vim-7.0.176/src/getchar.c        Tue Oct  3 15:36:09 2006
20 --- src/getchar.c       Tue Dec  5 21:17:42 2006
21 ***************
22 *** 76,82 ****
23    */
24   static mapblock_T     *first_abbr = NULL; /* first entry in abbrlist */
25   
26 ! static int            KeyNoremap = FALSE; /* remapping disabled */
27   
28   /*
29    * variables used by vgetorpeek() and flush_buffers()
30 --- 76,82 ----
31    */
32   static mapblock_T     *first_abbr = NULL; /* first entry in abbrlist */
33   
34 ! static int            KeyNoremap = 0;     /* remapping flags */
35   
36   /*
37    * variables used by vgetorpeek() and flush_buffers()
38 ***************
39 *** 1035,1040 ****
40 --- 1037,1044 ----
41   /*
42    * Put character "c" back into the typeahead buffer.
43    * Can be used for a character obtained by vgetc() that needs to be put back.
44 +  * Uses cmd_silent, KeyTyped and KeyNoremap to restore the flags belonging to
45 +  * the char.
46    */
47       void
48   ins_char_typebuf(c)
49 ***************
50 *** 1061,1067 ****
51         buf[1] = NUL;
52   #endif
53       }
54 !     (void)ins_typebuf(buf, REMAP_YES, 0, !KeyTyped, FALSE);
55   }
56   
57   /*
58 --- 1065,1071 ----
59         buf[1] = NUL;
60   #endif
61       }
62 !     (void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent);
63   }
64   
65   /*
66 ***************
67 *** 2270,2278 ****
68                                         gotchars(typebuf.tb_buf
69                                                          + typebuf.tb_off, 1);
70                                     }
71 !                                   KeyNoremap = (typebuf.tb_noremap[
72 !                                                  typebuf.tb_off]
73 !                                                      & (RM_NONE|RM_SCRIPT));
74                                     del_typebuf(1, 0);
75                                 }
76                                 break;      /* got character, break for loop */
77 --- 2276,2283 ----
78                                         gotchars(typebuf.tb_buf
79                                                          + typebuf.tb_off, 1);
80                                     }
81 !                                   KeyNoremap = typebuf.tb_noremap[
82 !                                                             typebuf.tb_off];
83                                     del_typebuf(1, 0);
84                                 }
85                                 break;      /* got character, break for loop */
86 ***************
87 *** 4196,4202 ****
88   
89       if (typebuf.tb_no_abbr_cnt)       /* abbrev. are not recursive */
90         return FALSE;
91 !     if (KeyNoremap)           /* no remapping implies no abbreviation */
92         return FALSE;
93   
94       /*
95 --- 4201,4208 ----
96   
97       if (typebuf.tb_no_abbr_cnt)       /* abbrev. are not recursive */
98         return FALSE;
99 !     if ((KeyNoremap & (RM_NONE|RM_SCRIPT)) != 0)
100 !       /* no remapping implies no abbreviation */
101         return FALSE;
102   
103       /*
104 *** ../vim-7.0.176/src/normal.c Tue Nov  7 18:43:10 2006
105 --- src/normal.c        Tue Dec  5 21:16:07 2006
106 ***************
107 *** 651,659 ****
108         /* Fake a "c"hange command.  When "restart_edit" is set (e.g., because
109          * 'insertmode' is set) fake a "d"elete command, Insert mode will
110          * restart automatically.
111 !        * Insert the typed character in the typeahead buffer, so that it will
112 !        * be mapped in Insert mode.  Required for ":lmap" to work.  May cause
113 !        * mapping a character from ":vnoremap"... */
114         ins_char_typebuf(c);
115         if (restart_edit != 0)
116             c = 'd';
117 --- 651,658 ----
118         /* Fake a "c"hange command.  When "restart_edit" is set (e.g., because
119          * 'insertmode' is set) fake a "d"elete command, Insert mode will
120          * restart automatically.
121 !        * Insert the typed character in the typeahead buffer, so that it can
122 !        * be mapped in Insert mode.  Required for ":lmap" to work. */
123         ins_char_typebuf(c);
124         if (restart_edit != 0)
125             c = 'd';
126 *** ../vim-7.0.176/src/version.c        Tue Dec  5 21:32:00 2006
127 --- src/version.c       Tue Dec  5 21:36:07 2006
128 ***************
129 *** 668,669 ****
130 --- 668,671 ----
131   {   /* Add new patch number below this line */
132 + /**/
133 +     177,
134   /**/
135
136 -- 
137 5 out of 4 people have trouble with fractions.
138
139  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
140 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
141 \\\        download, build and distribute -- http://www.A-A-P.org        ///
142  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.046479 seconds and 3 git commands to generate.