Commit 4f4de637 authored by Thorben Kroeger's avatar Thorben Kroeger Committed by hjk

FakeVim: implement C-u in insert mode

In insert mode:
input:  "aaa bbb ccc|"
keys:   C-u
result: ""

Change-Id: I1813369c401aaee1a634c363ca5f4c252062613c
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent dba12a1e
......@@ -4914,6 +4914,15 @@ void FakeVimHandler::Private::handleInsertMode(const Input &input)
const int beginPos = position();
Range range(beginPos, endPos, RangeCharMode);
removeText(range);
} else if (input.isControl('u')) {
const int blockNumber = m_cursor.blockNumber();
const int endPos = position();
moveToStartOfLine();
if (blockNumber != m_cursor.blockNumber())
moveToEndOfLine();
const int beginPos = position();
Range range(beginPos, endPos, RangeCharMode);
removeText(range);
} else if (input.isKey(Key_Insert)) {
g.mode = ReplaceMode;
} else if (input.isKey(Key_Left)) {
......
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