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
07d79251
Commit
07d79251
authored
Nov 23, 2022
by
Waqar Ahmed
Browse files
Fix code action shortcut
(cherry picked from commit
1a828346
)
parent
b42bb3e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientpluginview.cpp
View file @
07d79251
...
...
@@ -648,7 +648,16 @@ public:
actionCollection
()
->
setDefaultShortcut
(
m_quickFix
,
QKeySequence
((
Qt
::
CTRL
|
Qt
::
Key_Period
)));
m_requestCodeAction
=
actionCollection
()
->
add
<
KActionMenu
>
(
QStringLiteral
(
"lspclient_code_action"
));
m_requestCodeAction
->
setText
(
i18n
(
"Code Action"
));
actionCollection
()
->
setDefaultShortcut
(
m_requestCodeAction
,
QKeySequence
((
Qt
::
ALT
|
Qt
::
Key_Enter
)));
QList
<
QKeySequence
>
scuts
;
scuts
<<
QKeySequence
(
Qt
::
ALT
|
Qt
::
Key_Return
)
<<
QKeySequence
(
Qt
::
ALT
|
Qt
::
Key_Enter
);
actionCollection
()
->
setDefaultShortcuts
(
m_requestCodeAction
,
scuts
);
connect
(
m_requestCodeAction
,
&
QWidgetAction
::
triggered
,
this
,
[
this
]
{
auto
view
=
m_mainWindow
->
activeView
();
if
(
m_requestCodeAction
&&
view
)
{
const
QPoint
p
=
view
->
cursorPositionCoordinates
();
m_requestCodeAction
->
menu
()
->
exec
(
view
->
mapToGlobal
(
p
));
}
});
connect
(
m_requestCodeAction
->
menu
(),
&
QMenu
::
aboutToShow
,
this
,
&
self_type
::
requestCodeAction
);
// general options
...
...
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