Use positionInBlock in BackwardsScanner

Change-Id: I7af777f1ff4d1b93e23462ceaf8b5989b8358d3b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2020-12-17 16:28:43 +01:00
parent b21a374136
commit be67b1ab54

View File

@@ -46,7 +46,7 @@ BackwardsScanner::BackwardsScanner(const QTextCursor &cursor,
{
_tokenize.setLanguageFeatures(languageFeatures);
_tokenize.setSkipComments(skipComments);
_text = _block.text().left(cursor.position() - cursor.block().position());
_text = _block.text().left(cursor.positionInBlock());
if (! suffix.isEmpty())
_text += suffix;