summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfelixh <felixh@github.com>2023-11-20 09:34:01 +1030
committerfelixh <felixh@github.com>2023-11-20 09:34:01 +1030
commit4054682006442546f6f27d2f88da97ed33662b96 (patch)
treee536b6c1d9a692189a328cfbd443cca69ef950a2
parentb55d1a5e8c2e58fdc6054a16fa440ecc0959edfa (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.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/run.rs b/src/run.rs
index 0c6f39f..257ede1 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -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