@hexdspace/react 0.1.47 → 0.1.48

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 CHANGED
@@ -901,6 +901,7 @@ declare class VimHandleKeyUseCase {
901
901
  private afterCursorChange;
902
902
  private applyFallbackCursor;
903
903
  private getCursorIndex;
904
+ private hasSelection;
904
905
  private findNextNonEmptyRegion;
905
906
  private resolveInterRegionFallback;
906
907
  }
package/dist/index.js CHANGED
@@ -3370,7 +3370,13 @@ var VimHandleKeyUseCase = class {
3370
3370
  if (e.ctrlKey || e.metaKey || e.altKey) return;
3371
3371
  const scopeId = this.query.getActiveScope();
3372
3372
  if (!scopeId) return;
3373
+ const activeKey = this.query.getActiveRegion(scopeId);
3374
+ if (!activeKey) return;
3375
+ const hasSelection = this.hasSelection(activeKey);
3373
3376
  this.selection.clearSelection({ kind: "activeScope" });
3377
+ if (!hasSelection) {
3378
+ this.selection.setCursor(activeKey, null);
3379
+ }
3374
3380
  const st = this.stateByScope.get(scopeId);
3375
3381
  if (st) {
3376
3382
  st.count = "";
@@ -3451,6 +3457,9 @@ var VimHandleKeyUseCase = class {
3451
3457
  const index = items.indexOf(cursor);
3452
3458
  return index >= 0 ? index : null;
3453
3459
  }
3460
+ hasSelection(key) {
3461
+ return this.query.getSelectedIds(key).length > 0 || this.query.getToggledIds(key).length > 0 || this.query.getRangeIds(key).length > 0;
3462
+ }
3454
3463
  findNextNonEmptyRegion(scopeId, activeKey, dir, count) {
3455
3464
  const regs = this.regions.list(scopeId);
3456
3465
  if (regs.length === 0) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexdspace/react",
3
- "version": "0.1.47",
3
+ "version": "0.1.48",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",