summaryrefslogtreecommitdiff
path: root/src/plugins/fakevim
diff options
context:
space:
mode:
authorhluk <hluk@email.cz>2013-08-12 19:43:08 +0200
committerhjk <hjk121@nokiamail.com>2013-08-13 09:51:22 +0200
commit9c5ae766a2ce346fac1ad488af4b164d977ed4cf (patch)
tree5064eec30f0a3dbf323daa6bb8482ccff7c89628 /src/plugins/fakevim
parente6641ac5d4f6a8aea37a07557da888eb5b61efb1 (diff)
downloadqt-creator-9c5ae766a2ce346fac1ad488af4b164d977ed4cf.tar.gz
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: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/fakevim')
-rw-r--r--src/plugins/fakevim/fakevimhandler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp
index 8e57399736..c13ea02e93 100644
--- a/src/plugins/fakevim/fakevimhandler.cpp
+++ b/src/plugins/fakevim/fakevimhandler.cpp
@@ -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));
else
scrollToLine(firstVisibleLine());
@@ -2839,6 +2839,7 @@ void FakeVimHandler::Private::moveDown(int n)
setPosition(position);
moveToTargetColumn();
+ updateScrollOffset();
}
void FakeVimHandler::Private::movePageDown(int count)