| To: vim-dev@vim.org |
| Subject: patch 7.0.207 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.0.207 |
| Problem: After patch 2.0.203 CSI and K_SPECIAL characters are escaped when |
| recorded and then again when the register is executed. |
| Solution: Remove escaping before putting the recorded characters in a |
| register. (Yukihiro Nakadaira) |
| Files: src/getchar.c, src/ops.c, src/proto/getchar.pro |
| |
| |
| |
| |
| |
| *** 4438,4443 **** |
| --- 4442,4476 ---- |
| *d = NUL; |
| } |
| return res; |
| + } |
| + |
| + /* |
| + * Remove escaping from CSI and K_SPECIAL characters. Reverse of |
| + * vim_strsave_escape_csi(). Works in-place. |
| + */ |
| + void |
| + vim_unescape_csi(p) |
| + char_u *p; |
| + { |
| + char_u *s = p, *d = p; |
| + |
| + while (*s != NUL) |
| + { |
| + if (s[0] == K_SPECIAL && s[1] == KS_SPECIAL && s[2] == KE_FILLER) |
| + { |
| + *d++ = K_SPECIAL; |
| + s += 3; |
| + } |
| + else if ((s[0] == K_SPECIAL || s[0] == CSI) |
| + && s[1] == KS_EXTRA && s[2] == (int)KE_CSI) |
| + { |
| + *d++ = CSI; |
| + s += 3; |
| + } |
| + else |
| + *d++ = *s++; |
| + } |
| + *d = NUL; |
| } |
| |
| /* |
| |
| |
| |
| *** 1042,1047 **** |
| --- 1042,1050 ---- |
| retval = FAIL; |
| else |
| { |
| + /* Remove escaping for CSI and K_SPECIAL in multi-byte chars. */ |
| + vim_unescape_csi(p); |
| + |
| /* |
| * We don't want to change the default register here, so save and |
| * restore the current register name. |
| |
| |
| |
| *** 56,61 **** |
| --- 56,62 ---- |
| extern int ExpandMappings __ARGS((regmatch_T *regmatch, int *num_file, char_u ***file)); |
| extern int check_abbr __ARGS((int c, char_u *ptr, int col, int mincol)); |
| extern char_u *vim_strsave_escape_csi __ARGS((char_u *p)); |
| + extern void vim_unescape_csi __ARGS((char_u *p)); |
| extern int makemap __ARGS((FILE *fd, buf_T *buf)); |
| extern int put_escstr __ARGS((FILE *fd, char_u *strstart, int what)); |
| extern void check_map_keycodes __ARGS((void)); |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 207, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 251. You've never seen your closest friends who usually live WAY too far away. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |