Skip to content

Commit

Permalink
Merge pull request #141 from ErichDonGubler/search-ignore-key-release
Browse files Browse the repository at this point in the history
fix(search): skip non-press key evts.
  • Loading branch information
AMythicDev authored Jun 3, 2024
2 parents b18dff1 + bdb30e9 commit 8ace3c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use crate::{error::MinusError, input::HashedEventRegister, screen};
use crate::{LineNumbers, PagerState};
use crossterm::{
cursor::{self, MoveTo},
event::{self, Event, KeyCode, KeyEvent, KeyModifiers},
event::{self, Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers},
style::Attribute,
terminal::{Clear, ClearType},
};
Expand Down Expand Up @@ -408,6 +408,7 @@ where
};

match so.ev.as_ref().unwrap() {
Event::Key(KeyEvent { kind, .. }) if *kind != KeyEventKind::Press => (),
// If Esc is pressed, cancel the search and also make sure that the search query is
// ")cleared
Event::Key(KeyEvent {
Expand Down

0 comments on commit 8ace3c9

Please sign in to comment.