From 798f990cd3782bd443198b9f7f90853f9bb57dd4 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Sat, 12 Aug 2023 18:45:16 +0200 Subject: [PATCH] changelog and notes for #1506 --- CHANGELOG.md | 1 + src/input.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c037659b..020367ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * fix symlink support for configuration files [[@TheBlackSheep3](https://github.com/TheBlackSheep3)] ([#1751](https://github.com/extrawurst/gitui/issues/1751)) * fix expansion of `~` in `commit.template` ([#1745](https://github.com/extrawurst/gitui/pull/1745)) * fix hunk (un)staging/reset for # of context lines != 3 ([#1746](https://github.com/extrawurst/gitui/issues/1746)) +* fix delay when opening external editor ([#1506](https://github.com/extrawurst/gitui/issues/1506)) ## [0.23.0] - 2022-06-19 diff --git a/src/input.rs b/src/input.rs index 47370445..2e6b04e4 100644 --- a/src/input.rs +++ b/src/input.rs @@ -12,7 +12,7 @@ use std::{ }; static FAST_POLL_DURATION: Duration = Duration::from_millis(100); -static SLOW_POLL_DURATION: Duration = Duration::from_millis(1000); +static SLOW_POLL_DURATION: Duration = Duration::from_millis(10000); /// #[derive(Clone, Copy, Debug)] @@ -123,6 +123,9 @@ impl Input { } tx.send(InputEvent::Input(e))?; + //Note: right after an input event we might have a reason to stop + // polling (external editor opening) so lets do a quick poll until the next input + // this fixes https://github.com/extrawurst/gitui/issues/1506 poll_duration = FAST_POLL_DURATION; } else { poll_duration = SLOW_POLL_DURATION;