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); + } } }