Skip to content

Commit

Permalink
fix: Do not allow sending empty messages to agents
Browse files Browse the repository at this point in the history
  • Loading branch information
timonv committed Jan 29, 2025
1 parent 53c7c13 commit c0e4743
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/frontend/chat_mode/on_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn on_key(app: &mut App, key: &KeyEvent) {
let current_input = app.text_input.lines().join("\n");

// `Ctrl-Enter` or `Shift-Enter` or `Ctrl-s` to send the message in the text input
if (key.code == KeyCode::Char('s')
if ((key.code == KeyCode::Char('s')
&& key
.modifiers
.contains(crossterm::event::KeyModifiers::CONTROL))
Expand All @@ -21,8 +21,8 @@ pub fn on_key(app: &mut App, key: &KeyEvent) {
|| (key.code == KeyCode::Enter
&& key
.modifiers
.contains(crossterm::event::KeyModifiers::SHIFT))
&& !current_input.is_empty()
.contains(crossterm::event::KeyModifiers::SHIFT)))
&& !current_input.trim().is_empty()
{
let message = if current_input.starts_with('/') {
handle_input_command(app)
Expand Down

0 comments on commit c0e4743

Please sign in to comment.