diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-12-21 15:08:07 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-12-21 17:12:15 +0900 |
commit | ab58c5edb79b4a5aa347e80deaeb612216a9d34e (patch) | |
tree | fd28899de0a1a1558961fef105f9a842376b94cf /src/shared/operations.ts | |
parent | 493ffc83b01bfbae5f84c66f4db0cc4e1f90a588 (diff) |
Add numeric prefix to repeat a command
Diffstat (limited to 'src/shared/operations.ts')
-rw-r--r-- | src/shared/operations.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/shared/operations.ts b/src/shared/operations.ts index 1ce5256..67c5ca8 100644 --- a/src/shared/operations.ts +++ b/src/shared/operations.ts @@ -508,3 +508,29 @@ export const valueOf = (o: any): Operation => { } throw new TypeError('Unknown operation type: ' + o.type); }; + +export const isNRepeatable = (type: string): boolean => { + switch (type) { + case SCROLL_VERTICALLY: + case SCROLL_HORIZONALLY: + case SCROLL_PAGES: + case NAVIGATE_HISTORY_PREV: + case NAVIGATE_HISTORY_NEXT: + case NAVIGATE_PARENT: + case TAB_CLOSE: + case TAB_CLOSE_FORCE: + case TAB_CLOSE_RIGHT: + case TAB_REOPEN: + case TAB_PREV: + case TAB_NEXT: + case TAB_DUPLICATE: + case ZOOM_IN: + case ZOOM_OUT: + case URLS_PASTE: + case FIND_NEXT: + case FIND_PREV: + case REPEAT_LAST: + return true; + } + return false; +}; |