Commit 4443532d authored by hjk's avatar hjk
Browse files

fakevim: record position before first keystroke as jump target



Change-Id: I52942a46bcd42eee4f8452a61a899d6d9b706563
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent a7b5a7a4
...@@ -904,6 +904,7 @@ public: ...@@ -904,6 +904,7 @@ public:
FakeVimHandler *q; FakeVimHandler *q;
Mode m_mode; Mode m_mode;
bool m_passing; // let the core see the next event bool m_passing; // let the core see the next event
bool m_firstKeyPending;
SubMode m_submode; SubMode m_submode;
SubSubMode m_subsubmode; SubSubMode m_subsubmode;
Input m_subsubdata; Input m_subsubdata;
...@@ -1114,6 +1115,7 @@ void FakeVimHandler::Private::init() ...@@ -1114,6 +1115,7 @@ void FakeVimHandler::Private::init()
m_submode = NoSubMode; m_submode = NoSubMode;
m_subsubmode = NoSubSubMode; m_subsubmode = NoSubSubMode;
m_passing = false; m_passing = false;
m_firstKeyPending = false;
m_findPending = false; m_findPending = false;
m_findStartPosition = -1; m_findStartPosition = -1;
m_fakeEnd = false; m_fakeEnd = false;
...@@ -1245,6 +1247,11 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev) ...@@ -1245,6 +1247,11 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
tc.setVisualNavigation(true); tc.setVisualNavigation(true);
setCursor(tc); setCursor(tc);
if (m_firstKeyPending) {
m_firstKeyPending = false;
recordJump();
}
if (m_fakeEnd) if (m_fakeEnd)
moveRight(); moveRight();
...@@ -1299,6 +1306,7 @@ void FakeVimHandler::Private::setupWidget() ...@@ -1299,6 +1306,7 @@ void FakeVimHandler::Private::setupWidget()
m_plaintextedit->setLineWrapMode(QPlainTextEdit::NoWrap); m_plaintextedit->setLineWrapMode(QPlainTextEdit::NoWrap);
} }
m_wasReadOnly = EDITOR(isReadOnly()); m_wasReadOnly = EDITOR(isReadOnly());
m_firstKeyPending = true;
updateEditor(); updateEditor();
importSelection(); importSelection();
......
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