Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
f1b2c912
Commit
f1b2c912
authored
Feb 11, 2022
by
Kåre Särs
Browse files
Fix crash in LSPClientCompletion
parent
c2d3fe59
Pipeline
#136226
passed with stage
in 2 minutes and 18 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientcompletion.cpp
View file @
f1b2c912
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment