From a2dadb3d0bf4f8850cc0dacc34ddc58fd9f2ef35 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 16 Apr 2021 12:30:47 +0200 Subject: TextEditor: Snippet ranges refactoring Parsed snippets are now reported in chunks of texts and variables. A variable has a index that can be used to identify matching variables and maybe a mangler that can be used to modify the variable when applying the snippet. This effictively moves the variable matching logic from the overlay to the parser of the snippet, which is needed to implement the LSP snippet parser. Task-number: QTCREATORBUG-22406 Change-Id: I6999554c6c6d0f1887c98bf732473f01aa1f230c Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditoroverlay.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/plugins/texteditor/texteditoroverlay.h') diff --git a/src/plugins/texteditor/texteditoroverlay.h b/src/plugins/texteditor/texteditoroverlay.h index e995f007c5d..d87a0fe7aab 100644 --- a/src/plugins/texteditor/texteditoroverlay.h +++ b/src/plugins/texteditor/texteditoroverlay.h @@ -92,14 +92,11 @@ public: inline int dropShadowWidth() const { return m_dropShadowWidth; } - bool hasCursorInSelection(const QTextCursor &cursor) const; - bool hasFirstSelectionBeginMoved() const; protected: - int selectionIndexForCursor(const QTextCursor &cursor) const; - QString selectionText(int selectionIndex) const; - QTextCursor assembleCursorForSelection(int selectionIndex) const; + QTextCursor cursorForSelection(const OverlaySelection &selection) const; + QTextCursor cursorForIndex(int selectionIndex) const; private: QPainterPath createSelectionPath(const QTextCursor &begin, const QTextCursor &end, const QRect& clip); -- cgit v1.2.3