aboutsummaryrefslogtreecommitdiff
path: root/src/app/input/modal.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-08-01 04:27:50 +0300
committerGitHub <noreply@github.com>2026-08-01 04:27:50 +0300
commitb76adc155d979705a353fd6dc87c702f9dfc6c22 (patch)
treef613254e0cfbfd2b4450a6a5f3ee7c0ba8136976 /src/app/input/modal.rs
parent8d190eddda2c74afa3dc043f8ec8020ffd7b5a94 (diff)
fix(input): preserve native key lifecycle across routing (#2142)
refs #2077 Co-authored-by: Jonathan Liebig <jonathan.liebig@gmail.com>
Diffstat (limited to 'src/app/input/modal.rs')
-rw-r--r--src/app/input/modal.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/app/input/modal.rs b/src/app/input/modal.rs
index d8a14602..0a5c13e5 100644
--- a/src/app/input/modal.rs
+++ b/src/app/input/modal.rs
@@ -309,7 +309,7 @@ pub(super) fn keybind_help_back(state: &mut AppState) {
pub(crate) fn handle_keybind_help_key(state: &mut AppState, key: TerminalKey) {
if state.keybind_help.search_focused {
- let text_char = keybind_help_text_char(key);
+ let text_char = keybind_help_text_char(key.clone());
match key.code {
KeyCode::Up => state.scroll_keybind_help(-1),
KeyCode::Down => state.scroll_keybind_help(1),
@@ -343,13 +343,13 @@ pub(crate) fn handle_keybind_help_key(state: &mut AppState, key: TerminalKey) {
KeyCode::PageDown => state.scroll_keybind_help(8),
KeyCode::Home => state.keybind_help.scroll = 0,
KeyCode::End => state.keybind_help.scroll = state.keybind_help_max_scroll(),
- _ if keybind_help_text_char(key) == Some('/') => {
+ _ if keybind_help_text_char(key.clone()) == Some('/') => {
state.keybind_help.search_focused = true;
state.keybind_help.scroll = 0;
}
KeyCode::Esc => keybind_help_back(state),
KeyCode::Enter => leave_modal(state),
- _ if keybind_help_text_char(key) == Some('?') => leave_modal(state),
+ _ if keybind_help_text_char(key.clone()) == Some('?') => leave_modal(state),
_ => {}
}
}
@@ -712,8 +712,8 @@ pub(crate) fn handle_resize_key(state: &mut AppState, raw_key: TerminalKey) {
let key = raw_key.as_key_event();
if key.code == KeyCode::Esc
|| key.code == KeyCode::Enter
- || state.keybinds.resize_mode.matches_prefix_key(raw_key)
- || state.keybinds.resize_mode.matches_direct_key(raw_key)
+ || state.keybinds.resize_mode.matches_prefix_key(&raw_key)
+ || state.keybinds.resize_mode.matches_direct_key(&raw_key)
{
if state.active.is_some() {
state.mode = Mode::Terminal;
@@ -1128,8 +1128,8 @@ impl App {
let key = raw_key.as_key_event();
if key.code == KeyCode::Esc
|| key.code == KeyCode::Enter
- || self.state.keybinds.resize_mode.matches_prefix_key(raw_key)
- || self.state.keybinds.resize_mode.matches_direct_key(raw_key)
+ || self.state.keybinds.resize_mode.matches_prefix_key(&raw_key)
+ || self.state.keybinds.resize_mode.matches_direct_key(&raw_key)
{
self.state.mode = if self.state.active.is_some() {
Mode::Terminal