Commit 114e72e1 authored by Kåre Särs's avatar Kåre Särs

Fix/Workaround ESC handling problems + clear highlighting first

parent 9fe5f36a
......@@ -490,13 +490,18 @@ void KatePluginSearchView::handleEsc(QEvent *e)
QKeyEvent *k = static_cast<QKeyEvent *>(e);
if (k->key() == Qt::Key_Escape && k->modifiers() == Qt::NoModifier) {
if (m_toolView->isVisible()) {
m_mainWindow->hideToolView(m_toolView);
static ulong lastTimeStamp;
if (lastTimeStamp == k->timestamp()) {
// Same as previous... This looks like a bug somewhere...
return;
}
else {
lastTimeStamp = k->timestamp();
if (!m_matchRanges.isEmpty()) {
clearMarks();
}
else if (m_toolView->isVisible()) {
m_mainWindow->hideToolView(m_toolView);
}
}
}
......@@ -1669,11 +1674,7 @@ bool KatePluginSearchView::eventFilter(QObject *obj, QEvent *event)
}
}
}
if ((obj == m_toolView) && (ke->key() == Qt::Key_Escape)) {
m_mainWindow->hideToolView(m_toolView);
event->accept();
return true;
}
// NOTE: Qt::Key_Escape is handeled by handleEsc
}
return QObject::eventFilter(obj, event);
}
......
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