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
10 Patch 7.3.534 (after 7.3.461)
11 Problem: When using an InsertCharPre autocommand autoindent fails.
12 Solution: Proper handling of v:char. (Alexey Radkov)
16 *** ../vim-7.3.533/src/edit.c 2012-05-18 16:35:17.000000000 +0200
17 --- src/edit.c 2012-06-01 14:41:06.000000000 +0200
25 /* Return quickly when there is nothing to do. */
26 if (!has_insertcharpre())
29 /* Lock the text to avoid weird things from happening. */
31 ! set_vim_var_char(c); /* set v:char */
33 if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL, FALSE, curbuf))
34 ! /* Get the new value of v:char. It may be empty or more than one
36 ! res = vim_strsave(get_vim_var_str(VV_CHAR));
40 set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
48 ! char_u buf[MB_MAXBYTES + 1];
53 /* Return quickly when there is nothing to do. */
54 if (!has_insertcharpre())
59 + buf[(*mb_char2bytes)(c, buf)] = NUL;
67 /* Lock the text to avoid weird things from happening. */
69 ! set_vim_var_string(VV_CHAR, buf, -1); /* set v:char */
72 if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL, FALSE, curbuf))
74 ! /* Get the value of v:char. It may be empty or more than one
75 ! * character. Only use it when changed, otherwise continue with the
76 ! * original character to avoid breaking autoindent. */
77 ! if (STRCMP(buf, get_vim_var_str(VV_CHAR)) != 0)
78 ! res = vim_strsave(get_vim_var_str(VV_CHAR));
81 set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
83 *** ../vim-7.3.533/src/version.c 2012-06-01 13:46:06.000000000 +0200
84 --- src/version.c 2012-06-01 14:42:19.000000000 +0200
88 { /* Add new patch number below this line */
94 hundred-and-one symptoms of being an internet addict:
95 11. You find yourself typing "com" after every period when using a word
98 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
99 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
100 \\\ an exciting new programming language -- http://www.Zimbu.org ///
101 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///