Commit b79f13df authored by hjk's avatar hjk Committed by hjk
Browse files

fakevim: make sure pending input is only processed once



Change-Id: I0c6141eff49413f66cfee9a1f117279cdfcd4f36
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 87fcf7eb
......@@ -1417,7 +1417,7 @@ EventResult FakeVimHandler::Private::handleKey(const Input &input)
if (m_mode == InsertMode || m_mode == ReplaceMode || m_mode == CommandMode) {
g.pendingInput.append(input);
const char code = m_mode == InsertMode ? 'i' : 'n';
if (g.mappings[code].mappingDone(&g.pendingInput))
if (g.mappings.value(code).mappingDone(&g.pendingInput))
return handleKey2();
if (g.inputTimer != -1)
killTimer(g.inputTimer);
......@@ -1429,34 +1429,33 @@ EventResult FakeVimHandler::Private::handleKey(const Input &input)
EventResult FakeVimHandler::Private::handleKey2()
{
Inputs pendingInput = g.pendingInput;
g.pendingInput.clear();
if (m_mode == InsertMode) {
EventResult result = EventUnhandled;
foreach (const Input &in, g.pendingInput) {
foreach (const Input &in, pendingInput) {
EventResult r = handleInsertMode(in);
if (r == EventHandled)
result = EventHandled;
}
g.pendingInput.clear();
return result;
}
if (m_mode == ReplaceMode) {
EventResult result = EventUnhandled;
foreach (const Input &in, g.pendingInput) {
foreach (const Input &in, pendingInput) {
EventResult r = handleReplaceMode(in);
if (r == EventHandled)
result = EventHandled;
}
g.pendingInput.clear();
return result;
}
if (m_mode == CommandMode) {
EventResult result = EventUnhandled;
foreach (const Input &in, g.pendingInput) {
foreach (const Input &in, pendingInput) {
EventResult r = handleCommandMode(in);
if (r == EventHandled)
result = EventHandled;
}
g.pendingInput.clear();
return result;
}
return EventUnhandled;
......
......@@ -6117,6 +6117,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QChar c(0x1E9E);
bool b = c.isPrint();
qDebug() << c << b;
// Notify Creator about auto run intention.
if (USE_AUTORUN)
qWarning("Creator: Switch on magic autorun.");
......
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