forked from qt-creator/qt-creator
TextEditor: Fix handling of multiline text for code assistant
Task-number: QTCREATORBUG-8544 Change-Id: Ic0cffe941309ee38cc62111960c5ddad46025a8c Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
dcd71423d2
commit
31cad45c0e
@@ -61,7 +61,8 @@ QString textAt(QTextCursor tc, int pos, int length)
|
||||
tc.setPosition(pos);
|
||||
tc.setPosition(pos + length, QTextCursor::KeepAnchor);
|
||||
|
||||
return tc.selectedText();
|
||||
// selectedText() returns U+2029 (PARAGRAPH SEPARATOR) instead of newline
|
||||
return tc.selectedText().replace(QChar::ParagraphSeparator, QLatin1Char('\n'));
|
||||
}
|
||||
|
||||
} // Util
|
||||
|
||||
Reference in New Issue
Block a user