Commit f1b2c912 authored by Kåre Särs's avatar Kåre Särs
Browse files

Fix crash in LSPClientCompletion

parent c2d3fe59
Pipeline #136226 passed with stage
in 2 minutes and 18 seconds
......@@ -425,13 +425,16 @@ public:
view->document()->replaceText(word, matching);
// NOTE: view->setCursorPosition() will invalidate the matches, so we save the
// additionalTextEdits before setting cursor-possition
const auto additionalTextEdits = m_matches.at(index.row()).additionalTextEdits;
if (addParens) {
// place the cursor in between (|)
view->setCursorPosition({view->cursorPosition().line(), view->cursorPosition().column() - 1});
}
if (m_autoImport) {
const auto additionalTextEdits = m_matches.at(index.row()).additionalTextEdits;
for (const auto &textEdit : additionalTextEdits) {
view->document()->insertText(textEdit.range.start(), textEdit.newText);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment