forked from qt-creator/qt-creator
FakeVim: Treat C-S-something as "not normal" in Input::is()
The problem triggering this change is that recently, C-S-s was not handled (as "Save all") anymore when there was nothing to change, and the keypress ended up in FakeVim. Now FakeVim filter for _exact_ C- modifier in Input::is(), letting C-S- pass as 'S-s' i.e. starting replacement of the rest of the line. Change-Id: I13499f5606c28fee148e410355bec7ffd6ed116a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -893,6 +893,11 @@ static bool isOnlyControlModifier(const Qt::KeyboardModifiers &mods)
|
|||||||
return (mods ^ ControlModifier) == Qt::NoModifier;
|
return (mods ^ ControlModifier) == Qt::NoModifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool hasControlModifier(const Qt::KeyboardModifiers &mods)
|
||||||
|
{
|
||||||
|
return mods.testFlag(ControlModifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Range::Range(int b, int e, RangeMode m)
|
Range::Range(int b, int e, RangeMode m)
|
||||||
: beginPos(qMin(b, e)), endPos(qMax(b, e)), rangemode(m)
|
: beginPos(qMin(b, e)), endPos(qMax(b, e)), rangemode(m)
|
||||||
@@ -1065,7 +1070,7 @@ public:
|
|||||||
|
|
||||||
bool is(int c) const
|
bool is(int c) const
|
||||||
{
|
{
|
||||||
return m_xkey == c && !isControl();
|
return m_xkey == c && !hasControlModifier(m_modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isControl() const
|
bool isControl() const
|
||||||
|
|||||||
Reference in New Issue
Block a user