Skip to content

Commit

Permalink
Fix gj/gk so it maintains cursor position
Browse files Browse the repository at this point in the history
  • Loading branch information
hetmankp committed Jul 15, 2019
1 parent 91e9e79 commit e14d23d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/actions/motion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ class MoveScreenLineCenter extends MoveByScreenLine {
}

@RegisterAction
export class MoveUpByScreenLine extends MoveByScreenLine {
export class MoveUpByScreenLine extends MoveByScreenLineMaintainDesiredColumn {
modes = [ModeName.Insert, ModeName.Normal, ModeName.Visual];
keys = [['g', 'k'], ['g', '<up>']];
movementType: CursorMovePosition = 'up';
Expand All @@ -914,7 +914,7 @@ export class MoveUpByScreenLine extends MoveByScreenLine {
}

@RegisterAction
class MoveDownByScreenLine extends MoveByScreenLine {
class MoveDownByScreenLine extends MoveByScreenLineMaintainDesiredColumn {
modes = [ModeName.Insert, ModeName.Normal, ModeName.Visual];
keys = [['g', 'j'], ['g', '<down>']];
movementType: CursorMovePosition = 'down';
Expand All @@ -928,7 +928,7 @@ class MoveDownByScreenLine extends MoveByScreenLine {
// and moving by screen line just snaps us back to the original position.
// Check PR #1600 for discussion.
@RegisterAction
class MoveUpByScreenLineVisualLine extends MoveByScreenLine {
class MoveUpByScreenLineVisualLine extends MoveByScreenLineMaintainDesiredColumn {
modes = [ModeName.VisualLine];
keys = [['g', 'k'], ['g', '<up>']];
movementType: CursorMovePosition = 'up';
Expand All @@ -937,7 +937,7 @@ class MoveUpByScreenLineVisualLine extends MoveByScreenLine {
}

@RegisterAction
class MoveDownByScreenLineVisualLine extends MoveByScreenLine {
class MoveDownByScreenLineVisualLine extends MoveByScreenLineMaintainDesiredColumn {
modes = [ModeName.VisualLine];
keys = [['g', 'j'], ['g', '<down>']];
movementType: CursorMovePosition = 'down';
Expand Down

0 comments on commit e14d23d

Please sign in to comment.