better scrollbar in codeblocks + enter anim for delegates
This commit is contained in:
@@ -42,9 +42,18 @@ QVariantList MarkdownParser::parse(const QString& source) {
|
||||
QStringLiteral("\\$\\$(.+?)\\$\\$"),
|
||||
QRegularExpression::DotMatchesEverythingOption);
|
||||
|
||||
auto makeBlock = [](LlmMarkdown::Type type) {
|
||||
auto makeBlock = [&](LlmMarkdown::Type type) {
|
||||
QVariantMap block;
|
||||
block.insert("type", static_cast<int>(type));
|
||||
// Stable per-position identity ("index:type") for the QML
|
||||
// ScriptModel: blocks that survive a re-parse keep their id, so
|
||||
// their delegates are updated in place instead of recreated
|
||||
// (which would drop code highlights mid-stream). The type is
|
||||
// part of the id so a block that changes type is rebuilt.
|
||||
block.insert("id",
|
||||
QString::number(static_cast<int>(blocks.size()))
|
||||
+ QLatin1Char(':')
|
||||
+ QString::number(static_cast<int>(type)));
|
||||
return block;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user