From 7f91c57945fd030dafb6d8134b3b8269854211b1 Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 25 Feb 2026 18:49:26 +0000 Subject: [PATCH] Make sure that when a heading is fully deleted the style is returned to paragraph --- src/libneochat/chatkeyhelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libneochat/chatkeyhelper.cpp b/src/libneochat/chatkeyhelper.cpp index c6756bcfe..c762f2356 100644 --- a/src/libneochat/chatkeyhelper.cpp +++ b/src/libneochat/chatkeyhelper.cpp @@ -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();