File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -556,10 +556,20 @@ void LlamaPlugin::processCompletionResponse(const QString &response)
556556 }
557557
558558 if (can_accept) {
559- TextEditor::TextSuggestion::Data data;
560- data.range .begin = Utils::Text::Position::fromCursor (cursor);
561- data.range .end = Utils::Text::Position::fromCursor (cursor);
562- data.position = Utils::Text::Position::fromCursor (cursor);
559+ TextSuggestion::Data data;
560+ Text::Position currentPos = Text::Position::fromCursor (cursor);
561+
562+ data.range .begin = currentPos;
563+ data.range .end = currentPos;
564+ data.position = currentPos;
565+
566+ data.range .begin .column -= pos_x;
567+ int separator = content_str.indexOf (" \n " );
568+ data.range .end .column = pos_x
569+ + (separator != -1 ? content_str.size () - separator - 1
570+ : content_str.size ());
571+
572+ // Workaround for QTCREATORBUG-33303
563573 data.position .column -= pos_x;
564574 data.text = cursor.block ().text () + content_str;
565575
You can’t perform that action at this time.
0 commit comments