@scresto09 commented on this pull request.
return;
- /* see cmd_goto_up() for explanation */ - one_above = p->line + num - 1; - one_above = one_above < last_line ? one_above : last_line - 1; - pos = SSM(p->sci, SCI_GETLINEENDPOSITION, one_above, 0); - SET_POS_NOX(p->sci, pos, FALSE); - SSM(p->sci, SCI_LINEDOWN, 0, 0); + new_line = doc_line_from_visible_delta(p, p->line, num, &previous); + + if (previous > -1) { + guint pos = SSM(p->sci, SCI_GETLINEENDPOSITION, previous, 0); + SET_POS_NOX(p->sci, pos, FALSE); + } + + if (new_line > p->line) SSM(p->sci, SCI_LINEDOWN, 0, 0);
It's just a detail but this code is useful to have the same behavior as VIM. With VIM, when the cursor is on the last line but not the last character and you press the down arrow, the cursor does not move. Without this code, the cursor will move to the end of the line.