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
d01808c3
Commit
d01808c3
authored
Aug 09, 2022
by
Pablo Rauzy
Committed by
Christoph Cullmann
Aug 14, 2022
Browse files
avoid moving a macro around if it's just for its description
parent
cbf31332
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/keyboardmacros/keyboardmacrosplugin.cpp
View file @
d01808c3
...
...
@@ -358,7 +358,7 @@ bool KeyboardMacrosPlugin::save(const QString &name)
// update GUI:
clearPluginViews
();
for
(
auto
&
pluginView
:
m_pluginViews
)
{
pluginView
->
addNamedMacro
(
name
,
m_macro
);
pluginView
->
addNamedMacro
(
name
,
m_macro
.
toString
()
);
}
// display feedback
displayMessage
(
i18n
(
"Saved '%1'"
,
name
),
KTextEditor
::
Message
::
Positive
);
...
...
@@ -498,7 +498,7 @@ KeyboardMacrosPluginView::KeyboardMacrosPluginView(KeyboardMacrosPlugin *plugin,
// add named macros to our menus
for
(
const
auto
&
[
name
,
macro
]
:
plugin
->
m_namedMacros
.
toStdMap
())
{
addNamedMacro
(
name
,
macro
);
addNamedMacro
(
name
,
macro
.
toString
()
);
}
// update current state if necessary
...
...
@@ -550,10 +550,10 @@ void KeyboardMacrosPluginView::macroLoaded(bool enable)
m_saveAction
->
setEnabled
(
enable
);
}
void
KeyboardMacrosPluginView
::
addNamedMacro
(
const
QString
&
name
,
const
Macro
&
macro
)
void
KeyboardMacrosPluginView
::
addNamedMacro
(
const
QString
&
name
,
const
QString
&
description
)
{
QAction
*
action
;
QString
label
=
KStringHandler
::
rsqueeze
(
name
+
QStringLiteral
(
": "
)
+
macro
.
toString
()
,
50
)
QString
label
=
KStringHandler
::
rsqueeze
(
name
+
QStringLiteral
(
": "
)
+
description
,
50
)
// avoid unwanted accelerators
.
replace
(
QRegularExpression
(
QStringLiteral
(
"&(?!&)"
)),
QStringLiteral
(
"&&"
));
...
...
addons/keyboardmacros/keyboardmacrosplugin.h
View file @
d01808c3
...
...
@@ -122,7 +122,7 @@ public:
void
recordingOn
();
void
recordingOff
();
void
macroLoaded
(
bool
enable
);
void
addNamedMacro
(
const
QString
&
name
,
const
Macro
&
macro
);
void
addNamedMacro
(
const
QString
&
name
,
const
QString
&
description
);
void
removeNamedMacro
(
const
QString
&
name
);
// Action slots
...
...
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