]> git.pld-linux.org Git - packages/vim.git/blame - 6.2.228
- fix for current libselinux
[packages/vim.git] / 6.2.228
CommitLineData
05649561
AG
1To: vim-dev@vim.org
2Subject: Patch 6.2.228
3Fcc: outbox
4From: Bram Moolenaar <Bram@moolenaar.net>
5Mime-Version: 1.0
6Content-Type: text/plain; charset=ISO-8859-1
7Content-Transfer-Encoding: 8bit
8------------
9
10Patch 6.2.228
11Problem: Receiving CTRL-\ CTRL-N after typing "f" or "m" doesn't switch Vim
12 back to Normal mode. Same for CTRL-\ CTRL-G.
13Solution: Check if the character typed after a command is CTRL-\ and obtain
14 another character to check for CTRL-N or CTRL-G, waiting up to
15 'ttimeoutlen' msec.
16Files: src/normal.c
17
18
19*** ../vim-6.2.227/src/normal.c Tue Jan 27 17:09:16 2004
20--- src/normal.c Tue Feb 3 16:26:11 2004
21***************
22*** 250,256 ****
23 {Ctrl_Y, nv_scroll_line, 0, FALSE},
24 {Ctrl_Z, nv_suspend, 0, 0},
25 {ESC, nv_esc, 0, FALSE},
26! {Ctrl_BSL, nv_normal, 0, 0},
27 {Ctrl_RSB, nv_ident, NV_NCW, 0},
28 {Ctrl_HAT, nv_hat, NV_NCW, 0},
29 {Ctrl__, nv_error, 0, 0},
30--- 250,256 ----
31 {Ctrl_Y, nv_scroll_line, 0, FALSE},
32 {Ctrl_Z, nv_suspend, 0, 0},
33 {ESC, nv_esc, 0, FALSE},
34! {Ctrl_BSL, nv_normal, NV_NCH_ALW, 0},
35 {Ctrl_RSB, nv_ident, NV_NCW, 0},
36 {Ctrl_HAT, nv_hat, NV_NCW, 0},
37 {Ctrl__, nv_error, 0, 0},
38***************
39*** 880,886 ****
40 #ifdef FEAT_CMDL_INFO
41 need_flushbuf |= add_to_showcmd(ca.nchar);
42 #endif
43! if (ca.nchar == 'r' || ca.nchar == '\'' || ca.nchar == '`')
44 {
45 cp = &ca.extra_char; /* need to get a third character */
46 if (ca.nchar != 'r')
47--- 880,887 ----
48 #ifdef FEAT_CMDL_INFO
49 need_flushbuf |= add_to_showcmd(ca.nchar);
50 #endif
51! if (ca.nchar == 'r' || ca.nchar == '\'' || ca.nchar == '`'
52! || ca.nchar == Ctrl_BSL)
53 {
54 cp = &ca.extra_char; /* need to get a third character */
55 if (ca.nchar != 'r')
56***************
57*** 992,997 ****
58--- 993,1035 ----
59 #endif
60 }
61
62+ /*
63+ * When the next character is CTRL-\ a following CTRL-N means the
64+ * command is aborted and we go to Normal mode.
65+ */
66+ if (cp == &ca.extra_char
67+ && ca.nchar == Ctrl_BSL
68+ && (ca.extra_char == Ctrl_N || ca.extra_char == Ctrl_G))
69+ {
70+ ca.cmdchar = Ctrl_BSL;
71+ ca.nchar = ca.extra_char;
72+ idx = find_command(ca.cmdchar);
73+ }
74+ else if (*cp == Ctrl_BSL)
75+ {
76+ long towait = (p_ttm >= 0 ? p_ttm : p_tm);
77+
78+ /* There is a busy wait here when typing "f<C-\>" and then
79+ * something different from CTRL-N. Can't be avoided. */
80+ while ((c = vpeekc()) <= 0 && towait > 0L)
81+ {
82+ do_sleep(towait > 50L ? 50L : towait);
83+ towait -= 50L;
84+ }
85+ if (c > 0)
86+ {
87+ c = safe_vgetc();
88+ if (c != Ctrl_N && c != Ctrl_G)
89+ vungetc(c);
90+ else
91+ {
92+ ca.cmdchar = Ctrl_BSL;
93+ ca.nchar = c;
94+ idx = find_command(ca.cmdchar);
95+ }
96+ }
97+ }
98+
99 #ifdef FEAT_MBYTE
100 /* When getting a text character and the next character is a
101 * multi-byte character, it could be a composing character.
102***************
103*** 7746,7754 ****
104 nv_normal(cap)
105 cmdarg_T *cap;
106 {
107! int c = safe_vgetc();
108!
109! if (c == Ctrl_N || c == Ctrl_G)
110 {
111 clearop(cap->oap);
112 if (restart_edit != 0 && p_smd)
113--- 7784,7790 ----
114 nv_normal(cap)
115 cmdarg_T *cap;
116 {
117! if (cap->nchar == Ctrl_N || cap->nchar == Ctrl_G)
118 {
119 clearop(cap->oap);
120 if (restart_edit != 0 && p_smd)
121***************
122*** 7766,7772 ****
123 }
124 #endif
125 /* CTRL-\ CTRL-G restarts Insert mode when 'insertmode' is set. */
126! if (c == Ctrl_G && p_im)
127 restart_edit = 'a';
128 }
129 else
130--- 7802,7808 ----
131 }
132 #endif
133 /* CTRL-\ CTRL-G restarts Insert mode when 'insertmode' is set. */
134! if (cap->nchar == Ctrl_G && p_im)
135 restart_edit = 'a';
136 }
137 else
138*** ../vim-6.2.227/src/version.c Tue Feb 3 16:20:37 2004
139--- src/version.c Tue Feb 3 16:28:19 2004
140***************
141*** 639,640 ****
142--- 639,642 ----
143 { /* Add new patch number below this line */
144+ /**/
145+ 228,
146 /**/
147
148--
149Time is an illusion. Lunchtime doubly so.
150 -- Ford Prefect, in Douglas Adams'
151 "The Hitchhiker's Guide to the Galaxy"
152
153 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
154/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
155\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
156 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
This page took 0.078402 seconds and 4 git commands to generate.