letter a to get from read only mode to edit mode implemented and working perfectly well

This commit is contained in:
filipriec
2025-02-25 14:23:50 +01:00
parent 5e11ea2585
commit 71b373d661
2 changed files with 9 additions and 1 deletions

View File

@@ -47,6 +47,14 @@ impl EventHandler {
) -> Result<(bool, String), Box<dyn std::error::Error>> {
if let Event::Key(key) = event {
if !self.is_edit_mode && config.is_enter_edit_mode(key.code, key.modifiers) {
if key.code == KeyCode::Char('a') {
// Move cursor position one character to the right (after current character)
let current_input = form_state.get_current_input();
if !current_input.is_empty() && form_state.current_cursor_pos < current_input.len() {
form_state.current_cursor_pos += 1;
self.ideal_cursor_column = form_state.current_cursor_pos;
}
}
self.is_edit_mode = true;
self.edit_mode_cooldown = true;
self.command_message = "Edit mode".to_string();