removed redundancy
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
// src/modes/handlers/event.rs
|
// src/modes/handlers/event.rs
|
||||||
|
|
||||||
use crossterm::event::{Event, KeyCode, KeyModifiers};
|
use crossterm::event::Event;
|
||||||
use crossterm::cursor::SetCursorStyle;
|
use crossterm::cursor::SetCursorStyle;
|
||||||
use crate::tui::terminal::{
|
use crate::tui::terminal::{
|
||||||
core::TerminalCore,
|
core::TerminalCore,
|
||||||
@@ -10,7 +10,6 @@ use crate::tui::terminal::{
|
|||||||
use crate::config::config::Config;
|
use crate::config::config::Config;
|
||||||
use crate::ui::handlers::form::FormState;
|
use crate::ui::handlers::form::FormState;
|
||||||
use crate::ui::handlers::rat_state::UiStateHandler;
|
use crate::ui::handlers::rat_state::UiStateHandler;
|
||||||
use crate::state::state::AppState;
|
|
||||||
use crate::modes::handlers::{edit, command_mode, read_only};
|
use crate::modes::handlers::{edit, command_mode, read_only};
|
||||||
use crate::config::key_sequences::KeySequenceTracker;
|
use crate::config::key_sequences::KeySequenceTracker;
|
||||||
use super::common;
|
use super::common;
|
||||||
|
|||||||
@@ -21,25 +21,4 @@ impl UiStateHandler {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep your existing handle_ui_action method if you need it for other UI actions
|
|
||||||
pub fn handle_ui_action(
|
|
||||||
ui_state: &mut UiState,
|
|
||||||
config: &Config,
|
|
||||||
key: KeyCode,
|
|
||||||
modifiers: KeyModifiers,
|
|
||||||
) -> bool {
|
|
||||||
let mut action_performed = false;
|
|
||||||
|
|
||||||
// Check for sidebar toggle
|
|
||||||
if let Some(action) = config.get_action_for_key_in_mode(&config.keybindings.common, key, modifiers) {
|
|
||||||
if action == "toggle_sidebar" {
|
|
||||||
ui_state.show_sidebar = !ui_state.show_sidebar;
|
|
||||||
action_performed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add other UI actions here following the same pattern
|
|
||||||
|
|
||||||
action_performed
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user