summaryrefslogtreecommitdiff
path: root/src/plugins/fakevim
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-07-06 15:12:24 +0200
committerhjk <qtc-committer@nokia.com>2010-07-06 16:42:03 +0200
commitcd433a52def9840edbeb4374a6d7be6f0f2a1969 (patch)
treeb0b435e851d30748da07aad4693e76b714f78c58 /src/plugins/fakevim
parent5f67f7c42b8b8f50d573020eaaaa83c099b7a1d6 (diff)
downloadqt-creator-cd433a52def9840edbeb4374a6d7be6f0f2a1969.tar.gz
fakevim: fix insertion of tabs in insert mode
(cherry picked from commit 474ec252a23745bf5106b239054c17d7dfc2fbf2)
Diffstat (limited to 'src/plugins/fakevim')
-rw-r--r--src/plugins/fakevim/fakevimhandler.cpp18
1 files changed, 11 insertions, 7 deletions
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();