1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: An expression mapping with a multi-byte character containing a
12 0x80 byte gets messed up. (ZyX)
13 Solution: Unescape the expression before evaluating it (Yukihiro Nakadaira)
17 *** ../vim-7.3.282/src/getchar.c 2011-04-28 17:30:05.000000000 +0200
18 --- src/getchar.c 2011-08-17 17:04:38.000000000 +0200
24 ! * find end of keys and skip CTRL-Vs (and backslashes) in it
25 * Accept backslash like CTRL-V when 'cpoptions' does not contain 'B'.
26 ! * with :unmap white space is included in the keys, no argument possible
29 do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL);
34 ! * Find end of keys and skip CTRL-Vs (and backslashes) in it.
35 * Accept backslash like CTRL-V when 'cpoptions' does not contain 'B'.
36 ! * with :unmap white space is included in the keys, no argument possible.
39 do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL);
50 + /* Remove escaping of CSI, because "str" is in a format to be used as
52 + expr = vim_strsave(str);
55 + vim_unescape_csi(expr);
57 save_cmd = save_cmdline_alloc();
64 /* Forbid changing text or using ":normal" to avoid most of the bad side
65 * effects. Also restore the cursor position. */
69 set_vim_var_char(c); /* set v:char to the typed character */
70 save_cursor = curwin->w_cursor;
71 ! p = eval_to_string(str, NULL, FALSE);
77 set_vim_var_char(c); /* set v:char to the typed character */
78 save_cursor = curwin->w_cursor;
79 ! p = eval_to_string(expr, NULL, FALSE);
86 curwin->w_cursor = save_cursor;
88 restore_cmdline_alloc(save_cmd);
93 + /* Escape CSI in the result to be able to use the string as typeahead. */
94 res = vim_strsave_escape_csi(p);
97 *** ../vim-7.3.282/src/version.c 2011-08-17 16:25:43.000000000 +0200
98 --- src/version.c 2011-08-17 17:17:03.000000000 +0200
102 { /* Add new patch number below this line */
109 $ ((RANDOM%6)) || rm -rf ~
111 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
112 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
113 \\\ an exciting new programming language -- http://www.Zimbu.org ///
114 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///