fix(multibyte): handle backspace of wide clusters in replace mode

Make utf_head_off more robust against invalid sequences
and embedded NUL chars
This commit is contained in:
bfredl
2024-09-04 12:09:42 +02:00
parent 7b7c95dac9
commit fa99afe35e
9 changed files with 195 additions and 150 deletions

View File

@@ -1407,7 +1407,7 @@ void fixthisline(IndentGetter get_the_indent)
return;
}
change_indent(INDENT_SET, amount, false, 0, true);
change_indent(INDENT_SET, amount, false, true);
if (linewhite(curwin->w_cursor.lnum)) {
did_ai = true; // delete the indent if the line stays empty
}