diff options
author | qkzk <qu3nt1n@gmail.com> | 2022-12-02 22:14:47 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2022-12-02 22:14:47 +0100 |
commit | bc54cc8cdbdbafcc5dfcbda7c880a91ee1b2fca0 (patch) | |
tree | dddd01d34a522eca2fc3c54e45ebcce2cd6a40f1 /src/actioner.rs | |
parent | 62837b199c68e279b4502c595685696118f6268f (diff) |
regex matcher updates as you type
Diffstat (limited to 'src/actioner.rs')
-rw-r--r-- | src/actioner.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/actioner.rs b/src/actioner.rs index 57ffb7e..a227728 100644 --- a/src/actioner.rs +++ b/src/actioner.rs @@ -144,6 +144,7 @@ impl Actioner { | Mode::Exec | Mode::Search | Mode::Goto + | Mode::RegexMatch | Mode::Filter => { status.selected().event_move_cursor_left(); Ok(()) @@ -164,6 +165,7 @@ impl Actioner { | Mode::Exec | Mode::Search | Mode::Goto + | Mode::RegexMatch | Mode::Filter => { status.selected().event_move_cursor_right(); Ok(()) @@ -182,6 +184,7 @@ impl Actioner { | Mode::Exec | Mode::Search | Mode::Goto + | Mode::RegexMatch | Mode::Filter => { status.selected().event_delete_char_left(); Ok(()) @@ -202,6 +205,7 @@ impl Actioner { | Mode::Exec | Mode::Search | Mode::Goto + | Mode::RegexMatch | Mode::Filter => { status.selected().event_delete_chars_right(); Ok(()) @@ -354,13 +358,13 @@ impl Actioner { /// Keybindings are read from `Config`. fn char(&self, status: &mut Status, c: char) -> FmResult<()> { match status.selected().mode { - Mode::Newfile - | Mode::Newdir - | Mode::Chmod - | Mode::Rename - | Mode::RegexMatch - | Mode::Filter => { + Mode::Newfile | Mode::Newdir | Mode::Chmod | Mode::Rename | Mode::Filter => { + status.selected().event_text_insertion(c); + Ok(()) + } + Mode::RegexMatch => { status.selected().event_text_insertion(c); + status.select_from_regex()?; Ok(()) } Mode::Goto | Mode::Exec | Mode::Search => { |