Make sure that when a heading is fully deleted the style is returned to paragraph

This commit is contained in:
James Graham
2026-02-25 18:49:26 +00:00
parent 8b9e470907
commit 7f91c57945

View File

@@ -206,6 +206,10 @@ bool ChatKeyHelper::backspace()
if (cursor.isNull()) {
return false;
}
if (cursor.blockFormat().headingLevel() > 0 && m_textItem->plainText().length() <= m_textItem->fixedStartChars().length() + 1) {
m_textItem->mergeFormatOnCursor(RichFormat::Paragraph);
return false;
}
if (cursor.position() <= m_textItem->fixedStartChars().length()) {
if (cursor.currentList() && m_textItem->canIndentListLessAtCursor()) {
m_textItem->indentListLessAtCursor();