summaryrefslogtreecommitdiff
path: root/indra/newview/llscripteditor.h
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-01-12 06:20:24 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2026-01-15 06:04:33 +0200
commitbb56e9dd9ff4b93c910bd1d72fb6cdba31be3ea9 (patch)
tree9028822ce8ec49365a23a9c10902d9dea9923922 /indra/newview/llscripteditor.h
parent5fa0910d6176f610de45548d8558fb53f00a0eda (diff)
#5278 Async syntax apply in slices to avoid UI stalls
Diffstat (limited to 'indra/newview/llscripteditor.h')
-rw-r--r--indra/newview/llscripteditor.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h
index 1ca26fbcc9..dcbfdf3085 100644
--- a/indra/newview/llscripteditor.h
+++ b/indra/newview/llscripteditor.h
@@ -29,6 +29,7 @@
#define LL_SCRIPTEDITOR_H
#include "lltexteditor.h"
+#include <cstddef>
class LLScriptEditor : public LLTextEditor
{
@@ -64,14 +65,29 @@ public:
protected:
friend class LLUICtrlFactory;
+ friend class LLScriptEditorSyntaxWorker;
LLScriptEditor(const Params& p);
private:
+ enum class SyntaxApplyState
+ {
+ Idle,
+ Building,
+ Inserting
+ };
void drawLineNumbers();
void updateSegments() override;
void drawSelectionBackground() override;
void ensureSyntaxWorker();
void queueSyntaxParse();
+ void queueSyntaxApply(LLWString text,
+ LLKeywords::segment_ops_t ops,
+ S32 text_generation,
+ U32 keywords_generation,
+ bool disable_highlight,
+ LLKeywords* keywords);
+ void processPendingSyntaxApply();
+ void resetPendingSyntaxApply();
LLKeywords mKeywordsLua;
LLKeywords mKeywordsLSL;
@@ -85,6 +101,18 @@ private:
bool mLastQueuedDisableHighlight;
LLKeywords* mLastQueuedKeywords;
class LLScriptEditorSyntaxWorker* mSyntaxWorker;
+ SyntaxApplyState mSyntaxApplyState;
+ LLWString mPendingApplyText;
+ LLKeywords::segment_ops_t mPendingApplyOps;
+ segment_vec_t mPendingApplySegments;
+ segment_set_t mPendingApplySegmentSet;
+ size_t mPendingApplyOpIndex;
+ size_t mPendingApplySegmentIndex;
+ LLStyleConstSP mPendingApplyStyle;
+ S32 mPendingApplyTextGeneration;
+ U32 mPendingApplyKeywordsGeneration;
+ bool mPendingApplyDisableHighlight;
+ LLKeywords* mPendingApplyKeywords;
};
#endif // LL_SCRIPTEDITOR_H