[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ktexteditor] src/vimode: When deciding whether to send unrecognised keypresses to the line edit,
From:       Simon St James <kdedevel () etotheipiplusone ! com>
Date:       2016-06-17 8:18:10
Message-ID: E1bDoyg-0002ZN-Ae () scm ! kde ! org
[Download RAW message or body]

Git commit 33ed249fe5692ce38573cfe8628134ba689042f9 by Simon St James.
Committed on 17/06/2016 at 08:14.
Pushed by sstjames into branch 'master'.

When deciding whether to send unrecognised keypresses to the line edit, use whether \
the line edit is visible or not rather than the more cryptic "are we in an \
interactive sed replace?".

M  +5    -4    src/vimode/emulatedcommandbar.cpp

http://commits.kde.org/ktexteditor/33ed249fe5692ce38573cfe8628134ba689042f9

diff --git a/src/vimode/emulatedcommandbar.cpp b/src/vimode/emulatedcommandbar.cpp
index 7f5fab4..70b09c5 100644
--- a/src/vimode/emulatedcommandbar.cpp
+++ b/src/vimode/emulatedcommandbar.cpp
@@ -565,12 +565,13 @@ bool EmulatedCommandBar::handleKeyPress(const QKeyEvent \
                *keyEvent)
     // is not dispatched from within KateViInputModeHandler::handleKeypress(...)
     // (so KateViInputModeManager::isHandlingKeypress() returns false), we lose \
                information about whether we are
     // in Visual Mode, Visual Line Mode, etc.  See VisualViMode::updateSelection( ).
-    m_suspendEditEventFiltering = true;
-    QKeyEvent keyEventCopy(keyEvent->type(), keyEvent->key(), keyEvent->modifiers(), \
                keyEvent->text(), keyEvent->isAutoRepeat(), keyEvent->count());
-    if (!m_interactiveSedReplaceMode->isActive()) {
+    if (m_edit->isVisible())
+    {
+        m_suspendEditEventFiltering = true;
+        QKeyEvent keyEventCopy(keyEvent->type(), keyEvent->key(), \
keyEvent->modifiers(), keyEvent->text(), keyEvent->isAutoRepeat(), \
keyEvent->count());  qApp->notify(m_edit, &keyEventCopy);
+        m_suspendEditEventFiltering = false;
     }
-    m_suspendEditEventFiltering = false;
     return true;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic