From cd433a52def9840edbeb4374a6d7be6f0f2a1969 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 6 Jul 2010 15:12:24 +0200 Subject: fakevim: fix insertion of tabs in insert mode (cherry picked from commit 474ec252a23745bf5106b239054c17d7dfc2fbf2) --- src/plugins/fakevim/fakevimhandler.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/plugins/fakevim') diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 6c3ff89eec..ce3bceb9a6 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -2644,14 +2644,18 @@ EventResult FakeVimHandler::Private::handleInsertMode(const Input &input) removeAutomaticIndentation(); moveUp(count() * (linesOnScreen() - 2)); m_lastInsertion.clear(); - } else if (input.isKey(Key_Tab) && hasConfig(ConfigExpandTab)) { + } else if (input.isKey(Key_Tab)) { m_justAutoIndented = 0; - const int ts = config(ConfigTabStop).toInt(); - const int col = logicalCursorColumn(); - QString str = QString(ts - col % ts, ' '); - m_lastInsertion.append(str); - insertText(str); - setTargetColumn(); + if (hasConfig(ConfigExpandTab)) { + const int ts = config(ConfigTabStop).toInt(); + const int col = logicalCursorColumn(); + QString str = QString(ts - col % ts, ' '); + m_lastInsertion.append(str); + insertText(str); + setTargetColumn(); + } else { + insertInInsertMode(input.raw()); + } } else if (input.isControl('d')) { // remove one level of indentation from the current line int shift = config(ConfigShiftWidth).toInt(); -- cgit v1.2.1