Don't update completion twice when setting cmd text.

See #190.
This commit is contained in:
Florian Bruhin 2014-10-20 06:17:20 +02:00
parent 9f242cb907
commit 013a9ff216

View File

@ -148,8 +148,9 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
"""
old_text = self.text()
self.setText(text)
if old_text != text:
# We want the completion to pop out here.
if old_text != text and len(old_text) == len(text):
# We want the completion to pop out here, but the cursor position
# won't change, so we make sure we emit update_completion.
self.update_completion.emit(self.prefix(), self.split(),
self._cursor_part)
self.setFocus()