TextEditor: move struct to implementation file

Change-Id: I40ed45ff5ee1f392514e24ab17cd0c3ec7c25dc6
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
This commit is contained in:
David Schulz
2024-01-25 08:31:13 +01:00
parent f4b3b85fee
commit 6888c07f11
2 changed files with 7 additions and 6 deletions

View File

@@ -18,6 +18,11 @@
namespace TextEditor {
struct BlockPreeditData {
int position;
QString text;
};
class SyntaxHighlighterRunnerPrivate : public QObject
{
Q_OBJECT
@@ -48,7 +53,7 @@ public:
void changeDocument(int from,
int charsRemoved,
const QString textAdded,
const QMap<int, SyntaxHighlighterRunner::BlockPreeditData> &blocksPreedit)
const QMap<int, BlockPreeditData> &blocksPreedit)
{
QTextCursor cursor(m_document);
cursor.setPosition(qMin(m_document->characterCount() - 1, from + charsRemoved));
@@ -191,7 +196,7 @@ void SyntaxHighlighterRunner::changeDocument(int from, int charsRemoved, int cha
{
QTC_ASSERT(m_document, return);
m_syntaxInfoUpdated = SyntaxHighlighter::State::InProgress;
QMap<int, SyntaxHighlighterRunner::BlockPreeditData> blocksPreedit;
QMap<int, BlockPreeditData> blocksPreedit;
QTextBlock block = m_document->findBlock(from);
const QTextBlock endBlock = m_document->findBlock(from + charsAdded);
while (block.isValid() && block != endBlock) {

View File

@@ -25,10 +25,6 @@ class TEXTEDITOR_EXPORT SyntaxHighlighterRunner : public QObject
Q_OBJECT
public:
using SyntaxHighlighterCreator = std::function<SyntaxHighlighter *()>;
struct BlockPreeditData {
int position;
QString text;
};
SyntaxHighlighterRunner(SyntaxHighlighterCreator creator,
QTextDocument *document,