diff options
author | hjk <qtc-committer@nokia.com> | 2009-01-27 12:44:42 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2009-01-27 12:44:42 +0100 |
commit | 21f15207fbc352604d25ac4f6770bf507e63a5b9 (patch) | |
tree | 3486b87bca0f3493d0ee26149fe1d9b8b06f643c /src/plugins/fakevim | |
parent | ccfbdf5b1b3037f9e8a817b5e6f713573b8a0a49 (diff) | |
download | qt-creator-21f15207fbc352604d25ac4f6770bf507e63a5b9.tar.gz |
Fixes: fakevim: more 'z' commands
Diffstat (limited to 'src/plugins/fakevim')
-rw-r--r-- | src/plugins/fakevim/fakevimhandler.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 591b307d96..b63ebd9062 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -688,17 +688,27 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, indentRegion(m_tc.block(), m_tc.block().next()); finishMovement(); } else if (m_submode == ZSubMode) { - if (key == Key_Return) { - // cursor line to top of window, cursor on first non-blank + //qDebug() << "Z_MODE " << cursorLineInDocument() << linesOnScreen(); + if (key == Key_Return || key == 't') { // cursor line to top of window + if (!m_mvcount.isEmpty()) + m_tc.setPosition(positionForLine(count())); scrollToLineInDocument(cursorLineInDocument()); - moveToFirstNonBlankOnLine(); + if (key == Key_Return) + moveToFirstNonBlankOnLine(); finishMovement(); - } else if (key == '.') { // center cursor line + } else if (key == '.' || key == 'z') { // cursor line to center of window + if (!m_mvcount.isEmpty()) + m_tc.setPosition(positionForLine(count())); scrollToLineInDocument(cursorLineInDocument() - linesOnScreen() / 2); - moveToFirstNonBlankOnLine(); + if (key == '.') + moveToFirstNonBlankOnLine(); finishMovement(); - } else if (key == 'z') { // center cursor line - scrollToLineInDocument(cursorLineInDocument() - linesOnScreen() / 2); + } else if (key == '-' || key == 'b') { // cursor line to bottom of window + if (!m_mvcount.isEmpty()) + m_tc.setPosition(positionForLine(count())); + scrollToLineInDocument(cursorLineInDocument() - linesOnScreen() - 1); + if (key == '-') + moveToFirstNonBlankOnLine(); finishMovement(); } else { qDebug() << "IGNORED Z_MODE " << key << text; |