forked from qt-creator/qt-creator
Utils: move TextPosition/Range to textutils
Change-Id: Id94a7a96f3b0f978e94850d67eb4b8fba6c18fe2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -97,11 +97,10 @@ void applyTextEdit(TextDocumentManipulatorInterface &manipulator,
|
||||
const TextEdit &edit,
|
||||
bool newTextIsSnippet)
|
||||
{
|
||||
using namespace Utils::Text;
|
||||
const Range range = edit.range();
|
||||
const QTextDocument *doc = manipulator.textCursorAt(manipulator.currentPosition()).document();
|
||||
const int start = positionInText(doc, range.start().line() + 1, range.start().character() + 1);
|
||||
const int end = positionInText(doc, range.end().line() + 1, range.end().character() + 1);
|
||||
const int start = Text::positionInText(doc, range.start().line() + 1, range.start().character() + 1);
|
||||
const int end = Text::positionInText(doc, range.end().line() + 1, range.end().character() + 1);
|
||||
if (newTextIsSnippet) {
|
||||
manipulator.replace(start, end - start, {});
|
||||
manipulator.insertCodeSnippet(start, edit.newText(), &parseSnippet);
|
||||
|
||||
Reference in New Issue
Block a user