From 6b215008e82cbce49f1390030d935ec267714256 Mon Sep 17 00:00:00 2001 From: Aiden Scandella Date: Fri, 22 Jul 2016 17:42:11 -0700 Subject: [PATCH] Use positions and helpers --- src/actions/actions.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/actions/actions.ts b/src/actions/actions.ts index 23bf33c94978..6abfa48625f7 100644 --- a/src/actions/actions.ts +++ b/src/actions/actions.ts @@ -2418,9 +2418,17 @@ abstract class MoveQuoteMatch extends BaseMovement { failed: true }; } + + let startPos = new Position(position.line, start); + let endPos = new Position(position.line, end); + if (!this.includeSurrounding) { + startPos = startPos.getRight(); + endPos = endPos.getLeft(); + } + return { - start: new Position(position.line, start + (this.includeSurrounding ? 0 : 1)), - stop: new Position(position.line, end + (this.includeSurrounding ? 0 : -1)) + start: startPos, + stop: endPos }; }