diff options
author | felixh <felixh@github.com> | 2023-11-20 09:34:01 +1030 |
---|---|---|
committer | felixh <felixh@github.com> | 2023-11-20 09:34:01 +1030 |
commit | 4054682006442546f6f27d2f88da97ed33662b96 (patch) | |
tree | e536b6c1d9a692189a328cfbd443cca69ef950a2 | |
parent | b55d1a5e8c2e58fdc6054a16fa440ecc0959edfa (diff) |
Fix ZZ behaviour on windows
We need to explicitly ignore any key Release event after a Z to allow for ZZ behaviour to work on windows
-rw-r--r-- | src/run.rs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2231,7 +2231,13 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> { show_cursor(); screen.flush()?; - if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) = event::read()? { + let mut next_key:Event = event::read()?; + // ignore exactly one keypress Release after a Z is entered + if let Event::Key(KeyEvent { kind: KeyEventKind::Release, .. }) = next_key { + next_key = event::read()?; + } + + if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) = next_key { match code { KeyCode::Char('Q') => { if state.match_vim_exit_behavior |