mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
LibGUI: Don't call on_escape_pressed from EditingEngines
The call will be handled in `TextEditor::keydown_event`, just after that `EditingEngine::on_key()` is called.
This commit is contained in:
committed by
Andreas Kling
parent
4aa0ef9f98
commit
201890e109
@@ -948,9 +948,7 @@ bool VimEditingEngine::on_key_in_normal_mode(KeyEvent const& event)
|
||||
// Handle first any key codes that are to be applied regardless of modifiers.
|
||||
switch (event.key()) {
|
||||
case (KeyCode::Key_Escape):
|
||||
if (m_editor->on_escape_pressed)
|
||||
m_editor->on_escape_pressed();
|
||||
return true;
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1136,9 +1134,7 @@ bool VimEditingEngine::on_key_in_visual_mode(KeyEvent const& event)
|
||||
switch (event.key()) {
|
||||
case (KeyCode::Key_Escape):
|
||||
switch_to_normal_mode();
|
||||
if (m_editor->on_escape_pressed)
|
||||
m_editor->on_escape_pressed();
|
||||
return true;
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1268,9 +1264,7 @@ bool VimEditingEngine::on_key_in_visual_line_mode(KeyEvent const& event)
|
||||
switch (event.key()) {
|
||||
case (KeyCode::Key_Escape):
|
||||
switch_to_normal_mode();
|
||||
if (m_editor->on_escape_pressed)
|
||||
m_editor->on_escape_pressed();
|
||||
return true;
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user