[squash] fix comment [skip ci]

This commit is contained in:
erw7
2020-05-26 17:23:04 +09:00
parent e6e6affc0e
commit e01fc33515
2 changed files with 3 additions and 5 deletions

View File

@@ -517,8 +517,8 @@ char_u *get_special_key_name(int c, int modifiers)
/// @param[in,out] srcp Source from which <> are translated. Is advanced to /// @param[in,out] srcp Source from which <> are translated. Is advanced to
/// after the <> name if there is a match. /// after the <> name if there is a match.
/// @param[in] src_len Length of the srcp. /// @param[in] src_len Length of the srcp.
/// @param[out] dst Location where translation result will be kept. Must have /// @param[out] dst Location where translation result will be kept. It must
/// at least six bytes. // be at least 19 bytes per "<x>" form.
/// @param[in] keycode Prefer key code, e.g. K_DEL in place of DEL. /// @param[in] keycode Prefer key code, e.g. K_DEL in place of DEL.
/// @param[in] in_string Inside a double quoted string /// @param[in] in_string Inside a double quoted string
/// ///

View File

@@ -189,13 +189,11 @@ size_t input_enqueue(String keys)
char *end = ptr + keys.size; char *end = ptr + keys.size;
while (rbuffer_space(input_buffer) >= 19 && ptr < end) { while (rbuffer_space(input_buffer) >= 19 && ptr < end) {
// A "\<x>" form occupies at least 1 characters, and produces up // A "<x>" form occupies at least 1 characters, and produces up
// to 19 characters (1 + 5 * 3 for the char and 3 for a modifier). // to 19 characters (1 + 5 * 3 for the char and 3 for a modifier).
// In the case of K_SPECIAL(0x80) or CSI(0x9B), 3 bytes are escaped and // In the case of K_SPECIAL(0x80) or CSI(0x9B), 3 bytes are escaped and
// needed, but since the keys are UTF-8, so the first byte cannot be // needed, but since the keys are UTF-8, so the first byte cannot be
// K_SPECIAL(0x80) or CSI(0x9B). // K_SPECIAL(0x80) or CSI(0x9B).
// In UTF-8, a 5-6 byte representation is now an invalid sequence, but we
// reserve a 19-byte buffer for maximum security.
uint8_t buf[19] = { 0 }; uint8_t buf[19] = { 0 };
unsigned int new_size unsigned int new_size
= trans_special((const uint8_t **)&ptr, (size_t)(end - ptr), buf, true, = trans_special((const uint8_t **)&ptr, (size_t)(end - ptr), buf, true,