Commit 9c5ae766 authored by hluk's avatar hluk Committed by hjk
Browse files

FakeVim: Fix scrolling on small movement

Fixes scrolling to center text cursor on screen on j/k and h/l on last
visible line.

Change-Id: I65a1144a99f44a3df4217bc8eb6ee5ae6ef89ad4
Reviewed-by: default avatarhjk <>
parent e6641ac5
......@@ -2145,7 +2145,7 @@ void FakeVimHandler::Private::leaveFakeVim(bool needUpdate)
// Move cursor line to middle of screen if it's not visible.
const int line = cursorLine();
if (line < firstVisibleLine() || line >= firstVisibleLine() + linesOnScreen())
if (line < firstVisibleLine() || line > firstVisibleLine() + linesOnScreen())
scrollToLine(qMax(0, line - linesOnScreen() / 2));
......@@ -2839,6 +2839,7 @@ void FakeVimHandler::Private::moveDown(int n)
void FakeVimHandler::Private::movePageDown(int count)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment