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
72320279
Commit
72320279
authored
Feb 09, 2021
by
Waqar Ahmed
Browse files
Block escape for vi/nvim/vim
parent
a39691d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/konsole/kateconsole.cpp
View file @
72320279
...
...
@@ -474,9 +474,15 @@ void KateConsole::handleEsc(QEvent *e)
return
;
}
auto
notInBlockEscApps
=
[](
QStringView
app
)
{
static
const
QLatin1String
blockEscApps
[]
=
{
QLatin1String
(
"vi"
),
QLatin1String
(
"vim"
),
QLatin1String
(
"nvim"
)};
return
std
::
find
(
std
::
begin
(
blockEscApps
),
std
::
end
(
blockEscApps
),
app
)
==
std
::
end
(
blockEscApps
);
};
QKeyEvent
*
k
=
static_cast
<
QKeyEvent
*>
(
e
);
if
(
k
->
key
()
==
Qt
::
Key_Escape
&&
k
->
modifiers
()
==
Qt
::
NoModifier
)
{
if
(
m_toolView
->
isVisible
())
{
auto
name
=
qobject_cast
<
TerminalInterface
*>
(
m_part
)
->
foregroundProcessName
();
if
(
m_toolView
->
isVisible
()
&&
notInBlockEscApps
(
name
))
{
m_mw
->
hideToolView
(
m_toolView
);
}
}
...
...
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