Move jump commands to grid reader, make them UTF-8 aware, and tidy up,

from Anindya Mukherjee.
This commit is contained in:
nicm
2021-02-22 06:53:04 +00:00
parent b04f8acb70
commit 8986c8dfcd
4 changed files with 206 additions and 216 deletions

View File

@ -1319,12 +1319,14 @@ append_key:
}
if (c->prompt_flags & PROMPT_SINGLE) {
s = utf8_tocstr(c->prompt_buffer);
if (strlen(s) != 1)
if (utf8_strlen(c->prompt_buffer) != 1)
status_prompt_clear(c);
else if (c->prompt_inputcb(c, c->prompt_data, s, 1) == 0)
status_prompt_clear(c);
free(s);
else {
s = utf8_tocstr(c->prompt_buffer);
if (c->prompt_inputcb(c, c->prompt_data, s, 1) == 0)
status_prompt_clear(c);
free(s);
}
}
changed: