Mercurial > vim
comparison src/getchar.c @ 29111:bfb205095634 v8.2.5076
patch 8.2.5076: unnecessary code
Commit: https://github.com/vim/vim/commit/2e7cba347fc8b746add12aa5e0e9f6218a76c788
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri Jun 10 15:30:32 2022 +0100
patch 8.2.5076: unnecessary code
Problem: Unnecessary code.
Solution: Remove code and replace with function call. (closes https://github.com/vim/vim/issues/10552)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 10 Jun 2022 16:45:03 +0200 |
parents | ae39554ad2ee |
children | 4e48651f2e48 |
comparison
equal
deleted
inserted
replaced
29110:7aef804534ff | 29111:bfb205095634 |
---|---|
1113 * Uses cmd_silent, KeyTyped and KeyNoremap to restore the flags belonging to | 1113 * Uses cmd_silent, KeyTyped and KeyNoremap to restore the flags belonging to |
1114 * the char. | 1114 * the char. |
1115 * Returns the length of what was inserted. | 1115 * Returns the length of what was inserted. |
1116 */ | 1116 */ |
1117 int | 1117 int |
1118 ins_char_typebuf(int c, int modifier) | 1118 ins_char_typebuf(int c, int modifiers) |
1119 { | 1119 { |
1120 char_u buf[MB_MAXBYTES * 3 + 4]; | 1120 char_u buf[MB_MAXBYTES * 3 + 4]; |
1121 int len = 0; | 1121 int len = special_to_buf(c, modifiers, TRUE, buf); |
1122 | 1122 |
1123 if (modifier != 0) | 1123 buf[len] = NUL; |
1124 { | |
1125 buf[0] = K_SPECIAL; | |
1126 buf[1] = KS_MODIFIER; | |
1127 buf[2] = modifier; | |
1128 buf[3] = NUL; | |
1129 len = 3; | |
1130 } | |
1131 if (IS_SPECIAL(c)) | |
1132 { | |
1133 buf[len] = K_SPECIAL; | |
1134 buf[len + 1] = K_SECOND(c); | |
1135 buf[len + 2] = K_THIRD(c); | |
1136 buf[len + 3] = NUL; | |
1137 len += 3; | |
1138 } | |
1139 else | |
1140 { | |
1141 char_u *end = add_char2buf(c, buf + len); | |
1142 *end = NUL; | |
1143 len = end - buf; | |
1144 } | |
1145 (void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent); | 1124 (void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent); |
1146 return len; | 1125 return len; |
1147 } | 1126 } |
1148 | 1127 |
1149 /* | 1128 /* |