From 73e6a536db7ca3297b43cb90723af9c150e0f572 Mon Sep 17 00:00:00 2001 From: James Graham Date: Sat, 21 Feb 2026 14:42:02 +0000 Subject: [PATCH] Make sure that we only insert a new block for headers. This makes sure that hitting return in a list just adds the next list item. --- src/libneochat/chatkeyhelper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libneochat/chatkeyhelper.cpp b/src/libneochat/chatkeyhelper.cpp index 8dce03b79..3d68d34fd 100644 --- a/src/libneochat/chatkeyhelper.cpp +++ b/src/libneochat/chatkeyhelper.cpp @@ -190,6 +190,11 @@ bool ChatKeyHelper::insertReturn(Qt::KeyboardModifiers modifiers) return false; } + // If we are not a heading or are in a list just pass enter as normal. + if (cursor.blockFormat().headingLevel() <= 0 || cursor.currentList()) { + return false; + } + // If there was a heading we always want to revert to Paragraph format. auto newBlockFormat = RichFormat::blockFormatForFormat(RichFormat::Paragraph); auto newCharFormat = cursor.charFormat();