Merge remote-tracking branch 'origin/pr/3179'

This commit is contained in:
Florian Bruhin 2017-10-26 09:43:42 +02:00
commit eee5f8263f
2 changed files with 19 additions and 2 deletions

View File

@ -186,8 +186,6 @@ class Completer(QObject):
# keep offering completions (see issue #1519)
self._ignore_change = True
else:
log.completion.debug("Will ignore next completion update.")
self._ignore_change = True
self._change_completed_part(text, before, after)
@pyqtSlot()
@ -284,7 +282,20 @@ class Completer(QObject):
# pad with a space if quick-completing the last entry
text += ' '
log.completion.debug("setting text = '{}', pos = {}".format(text, pos))
# generally, we don't want to let self._cmd emit cursorPositionChanged,
# because that'll schedule a completion update. That happens when
# tabbing through the completions, and we want to change the command
# text but we also want to keep the original completion list for the
# command the user manually entered. The exception is when we're
# immediately completing, in which case we *do* want to update the
# completion view so that we can start completing the next part
if not immediate:
self._cmd.blockSignals(True)
self._cmd.setText(text)
self._cmd.setCursorPosition(pos)
self._cmd.setFocus()
self._cmd.blockSignals(False)
self._cmd.show_cmd.emit()

View File

@ -95,3 +95,9 @@ Feature: Using completion
Then the following tabs should be open:
- data/hello2.txt (active)
- data/hello.txt
Scenario: Space updates completion model after selecting full command
When I run :set-cmd-text :set
And I run :completion-item-focus next
When I run :set-cmd-text -s :set
Then the completion model should be option