mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-10-04 07:38:27 +03:00
Fix gj
and gk
in visual mode
Our stupid representation of visual selections has bitten our ass once again. Fixes #4544
This commit is contained in:
parent
35d06e6780
commit
3f53243192
@ -53,6 +53,17 @@ abstract class MoveByScreenLine extends BaseMovement {
|
||||
vimState: VimState,
|
||||
count: number
|
||||
): Promise<Position | IMovement> {
|
||||
if (
|
||||
vimState.currentMode === Mode.Visual &&
|
||||
vimState.cursorStopPosition.isAfterOrEqual(vimState.cursorStartPosition)
|
||||
) {
|
||||
// The selection is on the right side of the cursor, while our representation considers the cursor to be the left edge
|
||||
vimState.editor.selection = new vscode.Selection(
|
||||
vimState.cursorStartPosition,
|
||||
vimState.cursorStopPosition
|
||||
);
|
||||
}
|
||||
|
||||
await vscode.commands.executeCommand('cursorMove', {
|
||||
to: this.movementType,
|
||||
select: vimState.currentMode !== Mode.Normal,
|
||||
|
Loading…
Reference in New Issue
Block a user