aboutsummaryrefslogtreecommitdiff
path: root/src/content/usecases
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-12-22 15:13:55 +0900
committerGitHub <noreply@github.com>2019-12-22 15:13:55 +0900
commit750be0263207b1275ae3911b5585343b49de2645 (patch)
treeb635290335c2db71a6723eb7759c84bcf33a34ff /src/content/usecases
parent896c2cf60d009c9b12d99a394287cfb1d5ee1e3a (diff)
parent1c8cef7cf673deb2c3d0c5e0b3617bf2f16d7c74 (diff)
Merge pull request #691 from ueokande/enable-addon-on-blacklisted-sites
Enable addon on blacklisted sites
Diffstat (limited to 'src/content/usecases')
-rw-r--r--src/content/usecases/KeymapUseCase.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/content/usecases/KeymapUseCase.ts b/src/content/usecases/KeymapUseCase.ts
index 074de72..7aa7e92 100644
--- a/src/content/usecases/KeymapUseCase.ts
+++ b/src/content/usecases/KeymapUseCase.ts
@@ -39,16 +39,16 @@ export default class KeymapUseCase {
nextOps(key: Key): { repeat: number, op: operations.Operation } | null {
const sequence = this.repository.enqueueKey(key);
const baseSequence = sequence.trimNumericPrefix();
+ const keymaps = this.keymapEntityMap();
+ const matched = keymaps.filter(([seq]) => seq.startsWith(sequence));
+ const baseMatched = keymaps.filter(([seq]) => seq.startsWith(baseSequence));
+
if (baseSequence.length() === 1 && this.blacklistKey(key)) {
// ignore if the input starts with black list keys
this.repository.clear();
return null;
}
- const keymaps = this.keymapEntityMap();
- const matched = keymaps.filter(([seq]) => seq.startsWith(sequence));
- const baseMatched = keymaps.filter(([seq]) => seq.startsWith(baseSequence));
-
if (matched.length === 1 &&
sequence.length() === matched[0][0].length()) {
// keys are matched with an operation