Fix problem of CHS on first character

When CHS is on first character of a negative number, should remove it.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
Christophe de Dinechin 2023-07-16 17:47:07 +02:00
parent b7aed578a1
commit b5dd83a692

View file

@ -2475,7 +2475,7 @@ bool user_interface::handle_digits(int key)
// Special case for change of sign
byte *ed = rt.editor();
byte *p = ed + cursor;
unicode c = 0;
unicode c = utf8_codepoint(p);
unicode dm = Settings.decimal_mark;
unicode ns = Settings.space;
unicode hs = Settings.space_based;
@ -2510,7 +2510,8 @@ bool user_interface::handle_digits(int key)
else if (c == '-')
{
rt.remove(p - ed, 1);
cursor--;
if (cursor)
cursor--;
}
else
{