forked from qt-creator/qt-creator
FakeVim: Fix searching in visual mode and with commands
Search in visual mode should select text up to matched position. Using commands should work with search movement; e.g. 'd2/needle<CR>'. Commands should be also properly canceled if search movement fails. Change-Id: Ic695dccaf3f36ccae2f2b1a93f888d5ba9805a78 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -122,7 +122,6 @@ class MiniBuffer : public QStackedWidget
|
||||
public:
|
||||
MiniBuffer() : m_label(new QLabel(this)), m_edit(new QLineEdit(this)), m_eventFilter(0)
|
||||
{
|
||||
m_edit->installEventFilter(this);
|
||||
connect(m_edit, SIGNAL(textEdited(QString)), SLOT(changed()));
|
||||
connect(m_edit, SIGNAL(cursorPositionChanged(int,int)), SLOT(changed()));
|
||||
connect(m_edit, SIGNAL(selectionChanged()), SLOT(changed()));
|
||||
@@ -206,18 +205,6 @@ private slots:
|
||||
emit edited(m_edit->text(), cursorPos, anchorPos);
|
||||
}
|
||||
|
||||
bool eventFilter(QObject *ob, QEvent *ev)
|
||||
{
|
||||
// cancel editing on escape
|
||||
if (m_eventFilter != 0 && ob == m_edit && ev->type() == QEvent::ShortcutOverride
|
||||
&& static_cast<QKeyEvent*>(ev)->key() == Qt::Key_Escape) {
|
||||
emit edited(QString(), -1, -1);
|
||||
ev->accept();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
QLabel *m_label;
|
||||
QLineEdit *m_edit;
|
||||
|
||||
Reference in New Issue
Block a user