minor changes

This commit is contained in:
filipriec
2025-04-07 21:32:02 +02:00
parent 70678432c6
commit 10e9c3ead0

View File

@@ -9,12 +9,7 @@ use crate::tui::terminal::core::TerminalCore;
use crate::tui::functions::common::form::{save, revert}; use crate::tui::functions::common::form::{save, revert};
use crate::modes::handlers::event::EventOutcome; use crate::modes::handlers::event::EventOutcome;
use crate::tui::functions::common::form::SaveOutcome; use crate::tui::functions::common::form::SaveOutcome;
use std::error::Error;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CommandOutcome {
ExitCommandMode(String),
// Other command-specific outcomes if needed
}
pub async fn handle_command_event( pub async fn handle_command_event(
key: KeyEvent, key: KeyEvent,
@@ -27,7 +22,7 @@ pub async fn handle_command_event(
terminal: &mut TerminalCore, terminal: &mut TerminalCore,
current_position: &mut u64, current_position: &mut u64,
total_count: u64, total_count: u64,
) -> Result<EventOutcome, Box<dyn std::error::Error>> { ) -> Result<EventOutcome, Box<dyn Error>> {
// Exit command mode (via configurable keybinding) // Exit command mode (via configurable keybinding)
if config.is_exit_command_mode(key.code, key.modifiers) { if config.is_exit_command_mode(key.code, key.modifiers) {
command_input.clear(); command_input.clear();
@@ -79,7 +74,7 @@ async fn process_command(
terminal: &mut TerminalCore, terminal: &mut TerminalCore,
current_position: &mut u64, current_position: &mut u64,
total_count: u64, total_count: u64,
) -> Result<EventOutcome, Box<dyn std::error::Error>> { ) -> Result<EventOutcome, Box<dyn Error>> {
// Clone the trimmed command to avoid borrow issues // Clone the trimmed command to avoid borrow issues
let command = command_input.trim().to_string(); let command = command_input.trim().to_string();
if command.is_empty() { if command.is_empty() {