refactor(mappings)!: remove #n as a notation for a function key (#17318)

This notation is hardly used and makes the behavior of the from_part
argument of nvim_replace_termcodes confusing.
This commit is contained in:
zeertzjq
2023-04-08 20:29:23 +08:00
committed by GitHub
parent e6d3f87dfd
commit 747264320c
4 changed files with 9 additions and 37 deletions

View File

@@ -905,19 +905,6 @@ char *replace_termcodes(const char *const from, const size_t from_len, char **co
src = from;
// Check for #n at start only: function key n
if ((flags & REPTERM_FROM_PART) && from_len > 1 && src[0] == '#'
&& ascii_isdigit(src[1])) { // function key
result[dlen++] = (char)K_SPECIAL;
result[dlen++] = 'k';
if (src[1] == '0') {
result[dlen++] = ';'; // #0 is F10 is "k;"
} else {
result[dlen++] = src[1]; // #3 is F3 is "k3"
}
src += 2;
}
// Copy each byte from *from to result[dlen]
while (src <= end) {
if (!allocated && dlen + 64 > buf_len) {