forked from qt-creator/qt-creator
TextEditor: Close popups with Ctrl-[
It's vim specific, but should not harm normal users, so make it available unconditionally. This is already done for Ctrl-N and Ctrl-P. Change-Id: Idd5d8cd754e692b3a4cafadae590eaf598bd57c8 Task-number: QTCREATORBUG-21886 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -559,6 +559,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
|
|||||||
switch (ke->key()) {
|
switch (ke->key()) {
|
||||||
case Qt::Key_N:
|
case Qt::Key_N:
|
||||||
case Qt::Key_P:
|
case Qt::Key_P:
|
||||||
|
case Qt::Key_BracketLeft:
|
||||||
if (ke->modifiers() == Qt::KeyboardModifiers(HostOsInfo::controlModifier())) {
|
if (ke->modifiers() == Qt::KeyboardModifiers(HostOsInfo::controlModifier())) {
|
||||||
e->accept();
|
e->accept();
|
||||||
return true;
|
return true;
|
||||||
@@ -573,6 +574,16 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
|
|||||||
e->accept();
|
e->accept();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case Qt::Key_BracketLeft:
|
||||||
|
// vim-style behavior
|
||||||
|
if (ke->modifiers() == Qt::KeyboardModifiers(HostOsInfo::controlModifier())) {
|
||||||
|
abort();
|
||||||
|
emit explicitlyAborted();
|
||||||
|
e->accept();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case Qt::Key_N:
|
case Qt::Key_N:
|
||||||
case Qt::Key_P:
|
case Qt::Key_P:
|
||||||
// select next/previous completion
|
// select next/previous completion
|
||||||
|
Reference in New Issue
Block a user