From 05c250a4035df701d75d1668f4beca419f9498f7 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 27 Jul 2016 12:51:05 +0200 Subject: [PATCH] Adjust selection in visual mode. Fixes #8 --- vim-sample/src/controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vim-sample/src/controller.ts b/vim-sample/src/controller.ts index 3c9bf538..98dab75e 100644 --- a/vim-sample/src/controller.ts +++ b/vim-sample/src/controller.ts @@ -63,7 +63,11 @@ export class Controller implements IController { } let maxCharacter = lineContent.length - 1; if (pos.character > maxCharacter) { - setPositionAndReveal(editor, pos.line, maxCharacter); + if (this._isVisual) { + setSelectionAndReveal(editor, sel.anchor, pos.line, maxCharacter); + } else { + setPositionAndReveal(editor, pos.line, maxCharacter); + } } }