Skip to content
GitLab
Menu
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
7ba6e27b
Commit
7ba6e27b
authored
Sep 05, 2021
by
Ilia Kats
Committed by
Christoph Cullmann
Sep 11, 2021
Browse files
override shouldStartCompletion
otherwise we don't get automatic completion for ^(, ^) and such
parent
0851c9d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/latexunicodecompletion/completionmodel.cpp
View file @
7ba6e27b
...
...
@@ -44,6 +44,13 @@ void LatexCompletionModel::completionInvoked(KTextEditor::View *view,
endResetModel
();
}
bool
LatexCompletionModel
::
shouldStartCompletion
(
KTextEditor
::
View
*
view
,
const
QString
&
insertedText
,
bool
userInsertion
,
const
KTextEditor
::
Cursor
&
position
)
{
Q_UNUSED
(
view
);
Q_UNUSED
(
position
);
return
userInsertion
&&
latexexpr
.
match
(
insertedText
).
hasMatch
();
}
bool
LatexCompletionModel
::
shouldAbortCompletion
(
KTextEditor
::
View
*
view
,
const
KTextEditor
::
Range
&
range
,
const
QString
&
currentCompletion
)
{
if
(
view
->
cursorPosition
()
<
range
.
start
()
||
view
->
cursorPosition
()
>
range
.
end
())
...
...
addons/latexunicodecompletion/completionmodel.h
View file @
7ba6e27b
...
...
@@ -27,6 +27,7 @@ class LatexCompletionModel : public KTextEditor::CodeCompletionModel, public KTe
public:
LatexCompletionModel
(
QObject
*
parent
);
KTextEditor
::
Range
completionRange
(
KTextEditor
::
View
*
view
,
const
KTextEditor
::
Cursor
&
position
)
override
;
bool
shouldStartCompletion
(
KTextEditor
::
View
*
view
,
const
QString
&
insertedText
,
bool
userInsertion
,
const
KTextEditor
::
Cursor
&
position
)
override
;
bool
shouldAbortCompletion
(
KTextEditor
::
View
*
view
,
const
KTextEditor
::
Range
&
range
,
const
QString
&
currentCompletion
)
override
;
void
completionInvoked
(
KTextEditor
::
View
*
view
,
const
KTextEditor
::
Range
&
range
,
InvocationType
invocationType
)
override
;
void
executeCompletionItem
(
KTextEditor
::
View
*
view
,
const
KTextEditor
::
Range
&
word
,
const
QModelIndex
&
index
)
const
override
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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