disabling : in the edit mode

This commit is contained in:
filipriec
2025-02-27 12:24:49 +01:00
parent 8698b64957
commit 312d5fff36
2 changed files with 30 additions and 8 deletions

View File

@@ -36,6 +36,7 @@ impl EventHandler {
}
}
pub async fn handle_event(
&mut self,
event: Event,
@@ -74,8 +75,8 @@ impl EventHandler {
return Ok((false, "".to_string()));
}
}
// Handle special case: Entering command mode with ":"
else if key.code == KeyCode::Char(':') {
// Only trigger command mode with ":" in read-only mode, not in edit mode
else if !self.is_edit_mode && key.code == KeyCode::Char(':') {
self.command_mode = true;
self.command_input.clear();
self.command_message.clear();