vi: make "g<key>" error message less likely to show garbage

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-09-15 13:53:42 +02:00
parent 7cef4817d6
commit de1996dac5

View File

@ -3933,7 +3933,9 @@ static void do_cmd(int c)
c1 = get_one_char(); c1 = get_one_char();
if (c1 != 'g') { if (c1 != 'g') {
buf[0] = 'g'; buf[0] = 'g';
buf[1] = c1; // TODO: if Unicode? // c1 < 0 if the key was special. Try "g<up-arrow>"
// TODO: if Unicode?
buf[1] = (c1 >= 0 ? c1 : '*');
buf[2] = '\0'; buf[2] = '\0';
not_implemented(buf); not_implemented(buf);
break; break;