@hexdspace/react 0.1.49 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -894,6 +894,7 @@ declare class VimHandleKeyUseCase {
|
|
|
894
894
|
reset(scopeId?: ScopeId): void;
|
|
895
895
|
handleChar(char: string, e: KeyboardEvent): void;
|
|
896
896
|
handleEscape(e: KeyboardEvent): void;
|
|
897
|
+
consumeCount(scopeId: ScopeId, def: number): number;
|
|
897
898
|
private applyDirectional;
|
|
898
899
|
private goToLast;
|
|
899
900
|
private goToIndex;
|
|
@@ -912,6 +913,7 @@ type VimModifierMovementActionArgs = {
|
|
|
912
913
|
key: RegionKey;
|
|
913
914
|
itemId: ItemId | null;
|
|
914
915
|
direction: VimDirection;
|
|
916
|
+
count: number;
|
|
915
917
|
event: KeyboardEvent;
|
|
916
918
|
};
|
|
917
919
|
type VimModifierMovementAction = (args: VimModifierMovementActionArgs) => void;
|
package/dist/index.js
CHANGED
|
@@ -3383,6 +3383,13 @@ var VimHandleKeyUseCase = class {
|
|
|
3383
3383
|
st.pending = null;
|
|
3384
3384
|
}
|
|
3385
3385
|
}
|
|
3386
|
+
consumeCount(scopeId, def) {
|
|
3387
|
+
const st = this.stateByScope.get(scopeId);
|
|
3388
|
+
if (!st) return def;
|
|
3389
|
+
const count = consumeCount(st, def);
|
|
3390
|
+
st.pending = null;
|
|
3391
|
+
return count;
|
|
3392
|
+
}
|
|
3386
3393
|
applyDirectional(scopeId, activeKey, dir, count) {
|
|
3387
3394
|
const meta = this.regions.get(activeKey);
|
|
3388
3395
|
if (meta?.intra.has(dir)) {
|
|
@@ -3608,7 +3615,8 @@ var VimController = class {
|
|
|
3608
3615
|
const action = actions?.[modifier]?.[dir];
|
|
3609
3616
|
if (!action) return;
|
|
3610
3617
|
const itemId = this.selection.getActiveItem(activeKey);
|
|
3611
|
-
|
|
3618
|
+
const count = this.handleKey.consumeCount(scopeId, 1);
|
|
3619
|
+
action({ scopeId, key: activeKey, itemId, direction: dir, count, event: e });
|
|
3612
3620
|
}
|
|
3613
3621
|
resetActiveScope() {
|
|
3614
3622
|
const scopeId = this.selection.getActiveScope();
|