[Qt-creator] auto scroll in editor on focus with FakeVim

kuba kubusg at gmail.com
Sat Feb 1 13:55:30 CET 2014


Hi,

I've recently noticed an annoying behavior. I use FakeVim and when I 
unfocus qt creator window and then focus it again, the editor scrolls 
automatically back to cursor position. It's because on QEvent::FocusIn, 
FakeVim uses leaveFakeVim() which by default scrolls to cursor. If you 
use leaveFakeVim(false) it does not. Is it possible to use false and not 
scroll or do other features need it?

Commit that introduced this change:
https://qt.gitorious.org/qt-creator/qt-creator/commit/a636a933d0a1f4dfd5a021c94c057f14d3a6bbf8

possible fix (trivial):

diff --git a/src/plugins/fakevim/fakevimhandler.cpp 
b/src/plugins/fakevim/fakevimhandler.cpp
index 5bdabae..48f4558 100644
--- a/src/plugins/fakevim/fakevimhandler.cpp
+++ b/src/plugins/fakevim/fakevimhandler.cpp
@@ -2176,7 +2176,7 @@ void FakeVimHandler::Private::focus()
          updateMiniBuffer();
      updateHighlights();

-    leaveFakeVim();
+    leaveFakeVim(false);
  }

  void FakeVimHandler::Private::enterFakeVim()

Regards,
Kuba



More information about the Qt-creator mailing list