Skip to content

Commit

Permalink
Don't update cursor position when going down on the last line
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed May 18, 2024
1 parent fa7025b commit 7ae19de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions vimode/src/cmds/motion.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,14 @@ void cmd_goto_up_nonempty(CmdContext *c, CmdParams *p)

static void goto_down(CmdParams *p, gint num)
{
gint one_above = doc_line_from_visible_delta(p, p->line, p->num - 1, NULL);
gint pos = SSM(p->sci, SCI_GETLINEENDPOSITION, one_above, 0);
gint one_above, pos;

if (p->line >= p->line_num - 1)
return;

one_above = doc_line_from_visible_delta(p, p->line, p->num - 1, NULL);
pos = SSM(p->sci, SCI_GETLINEENDPOSITION, one_above, 0);

SET_POS_NOX(p->sci, pos, FALSE);
SSM(p->sci, SCI_LINEDOWN, 0, 0);
}
Expand Down

0 comments on commit 7ae19de

Please sign in to comment.