From b0bd3529ed1ed852b647f2bf19a7391976beaa1c Mon Sep 17 00:00:00 2001 From: Steven Guh Date: Tue, 30 Nov 2021 18:57:57 -0800 Subject: [PATCH] Store `when` before pushing new key to queue Once key is in the queue, it will usually execute immediately. Therefore, the `when` condition couldn't be evaluated. This fixes https://github.com/VSpaceCode/VSpaceCode/issues/256 --- CHANGELOG.md | 4 ++++ src/menu/baseWhichKeyMenu.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4795222..6294383 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix an issue where `when` in conditional bindings couldn't be evaluated since v0.10.0. ([VSpaceCode/#256](https://github.com/VSpaceCode/VSpaceCode/issues/256)) + ## [0.11.0] - 2021-11-29 ### Added diff --git a/src/menu/baseWhichKeyMenu.ts b/src/menu/baseWhichKeyMenu.ts index 9a006d8..cf61358 100644 --- a/src/menu/baseWhichKeyMenu.ts +++ b/src/menu/baseWhichKeyMenu.ts @@ -150,8 +150,8 @@ export abstract class BaseWhichKeyMenu implement // ], // } // ``` - this._valueQueue.push(arg.key); this._when = arg.when; + this._valueQueue.push(arg.key); } private handleDidAccept(): void {