diff --git a/package.json b/package.json index df5f79f..6856208 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "publisher": "haberdashPI", "repository": "https://github.com/haberdashPI/vscode-selection-utilities", "description": "Kakaune-inspired collection of useful commands for manipulating selections.", - "version": "0.6.7", + "version": "0.6.6", "icon": "logo.png", "engines": { "vscode": "^1.92.0" @@ -465,4 +465,4 @@ "@wdio/spec-reporter": "^8.40.3", "ts-node": "^10.9.2" } -} +} \ No newline at end of file diff --git a/src/web/unitMotions.ts b/src/web/unitMotions.ts index 1edf5e5..71d2cf8 100644 --- a/src/web/unitMotions.ts +++ b/src/web/unitMotions.ts @@ -439,7 +439,7 @@ function* resolveUnitBoundaries( ): Generator { let backwards: Generator; function* resolveHelper(firstUnit: Range, back: Range): Generator { - if (resolve === Boundary.Start && (!firstUnit?.start || !forward)) { + if (resolve === Boundary.Start) { if (forward) { if (!firstUnit?.start) { firstUnit = fuseRanges(firstUnit, back); @@ -465,7 +465,7 @@ function* resolveUnitBoundaries( } yield firstUnit; } - } else if (resolve === Boundary.End && (!firstUnit?.end || forward)) { + } else if (resolve === Boundary.End) { if (!forward) { if (!firstUnit?.end) { firstUnit = fuseRanges(firstUnit, back); diff --git a/test/specs/moveBySection.ux.mts b/test/specs/moveBySection.ux.mts index d068e02..562df90 100644 --- a/test/specs/moveBySection.ux.mts +++ b/test/specs/moveBySection.ux.mts @@ -97,6 +97,18 @@ describe('Section Motion', () => { ` ); + + await editor.moveCursor(10, 1); + await parMoveSelects( + {selectWhole: true, boundary: 'start'}, + `# B + # -------------------- + + billybob + bim + + ` + ); }); it('Can move by end', async () => { @@ -117,6 +129,19 @@ describe('Section Motion', () => { # B # --------------------` ); + + await editor.moveCursor(9, 1); + + await parMoveSelects( + {selectWhole: true, boundary: 'end'}, + ` + + billybob + bim + + # A.2 + # --------------------` + ); }); it('Can move backwards by start', async () => { @@ -137,6 +162,17 @@ describe('Section Motion', () => { it('Can move backwards by end', async () => { await editor.moveCursor(9, 1); + await parMoveSelects( + {selectWhole: true, boundary: 'end', value: -1}, + ` + + billybob + bim + + # A.2 + # --------------------` + ); + await parMoveSelects( {selectWhole: true, boundary: 'end', value: -1}, `