Merge branch 'rcorre-completer_unicode'

This commit is contained in:
Florian Bruhin 2016-10-05 21:16:42 +02:00
commit d1f21745e4
2 changed files with 6 additions and 0 deletions

View File

@ -157,6 +157,7 @@ class Completer(QObject):
result = runner.parse(text, fallback=True, keep=True)
parts = [x for x in result.cmdline if x]
pos = self._cmd.cursorPosition() - len(self._cmd.prefix())
pos = min(pos, len(text)) # Qt treats 2-byte UTF-16 chars as 2 chars
log.completion.debug('partitioning {} around position {}'.format(parts,
pos))
for i, part in enumerate(parts):

View File

@ -22,3 +22,8 @@ Feature: Command bar completion
# Make sure qutebrowser doesn't hang
And I run :message-info "Still alive!"
Then the message "Still alive!" should be shown
Scenario: Crash when pasting emoji into the command line (#2007)
Given I open about:blank
When I run :set-cmd-text -s :🌀
Then no crash should happen