From fc1780f126415523f1298fdf8d73b6270fd970c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Aum=C3=BCller?= Date: Mon, 11 Jan 2010 17:54:02 +0100 Subject: [PATCH] don't allow keys with empty text to reset the currently selected completion item forwarding keys with empty text() does not restrict the matching items, but updating the list of possible completions resets the currently selected item to the first one --- src/plugins/texteditor/completionwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/texteditor/completionwidget.cpp b/src/plugins/texteditor/completionwidget.cpp index ed8a7e250c8..fb766e2d20f 100644 --- a/src/plugins/texteditor/completionwidget.cpp +++ b/src/plugins/texteditor/completionwidget.cpp @@ -211,6 +211,9 @@ bool CompletionWidget::event(QEvent *e) forwardKeys = false; break; default: + // if a key is forwarded, completion widget is re-opened and selected item is reset to first, + // so only forward keys that insert text and refine the completed item + forwardKeys = !ke->text().isEmpty(); break; }