Make backspace erase combining characters
They might not be even printed correctly, though. Updates #4
This commit is contained in:
parent
33a8e26efc
commit
5d0c105b10
9
sdn.cpp
9
sdn.cpp
|
@ -1186,8 +1186,13 @@ fun handle_editor (wint_t c) {
|
||||||
g.editor_on_confirm = nullptr;
|
g.editor_on_confirm = nullptr;
|
||||||
break;
|
break;
|
||||||
case ACTION_INPUT_B_DELETE:
|
case ACTION_INPUT_B_DELETE:
|
||||||
if (g.editor_cursor > 0)
|
// Remove the last character including its postfix combining characters
|
||||||
g.editor_line.erase (--g.editor_cursor, 1);
|
while (g.editor_cursor > 0) {
|
||||||
|
auto erased = g.editor_line.at (--g.editor_cursor);
|
||||||
|
g.editor_line.erase (g.editor_cursor, 1);
|
||||||
|
if (wcwidth (erased))
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (c & (ALT | SYM)) {
|
if (c & (ALT | SYM)) {
|
||||||
|
|
Loading…
Reference in New Issue