From 2065f292ab5b7d4f5b84559c81fd0edf0f73a2ac Mon Sep 17 00:00:00 2001 From: Nick Ginther Date: Wed, 25 May 2016 16:45:06 -0500 Subject: [PATCH 1/3] fix crash on empty parts[] (#1523) --- qutebrowser/completion/completer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qutebrowser/completion/completer.py b/qutebrowser/completion/completer.py index ffc4db3a0..2f2823611 100644 --- a/qutebrowser/completion/completer.py +++ b/qutebrowser/completion/completer.py @@ -204,6 +204,8 @@ class Completer(QObject): parts, cursor_part = self._filter_cmdline_parts(parts, cursor_part) log.completion.debug("After filtering flags: parts {}, cursor_part " "{}".format(parts, cursor_part)) + if not parts: + return None if cursor_part == 0: # '|' or 'set|' model = instances.get(usertypes.Completion.command) From 1ea99c595889b63ea8cfa7f8cda6876d5e83c7cb Mon Sep 17 00:00:00 2001 From: Nick Ginther Date: Wed, 25 May 2016 17:52:36 -0500 Subject: [PATCH 2/3] add completing single option argument test --- tests/integration/features/misc.feature | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integration/features/misc.feature b/tests/integration/features/misc.feature index 372bcf48a..84ee7fcc3 100644 --- a/tests/integration/features/misc.feature +++ b/tests/integration/features/misc.feature @@ -431,3 +431,9 @@ Feature: Various utility commands. Given I have a fresh instance When I run :messages Then the page should contain the plaintext "No messages to show." + + ## https://github.com/The-Compiler/qutebrowser/issues/1523 + + Scenario: Completing a single option argument + When I run :set-cmd-text -s :-- + Then no crash should happen From 998f025553284422d167bebaf03322ecdc0580f9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 26 May 2016 07:45:17 +0200 Subject: [PATCH 3/3] Update docs --- CHANGELOG.asciidoc | 1 + README.asciidoc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index cf9195b08..b574cd0a7 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -64,6 +64,7 @@ Fixed primary selection - Don't display quit confirmation with finished downloads - Fixed updating the tab index in the statusbar when opening a background tab +- Fixed a crash when entering `:-- ` in the commandline v0.6.2 ------ diff --git a/README.asciidoc b/README.asciidoc index 95b6b8271..f5a1bc492 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -179,6 +179,7 @@ Contributors, sorted by the number of commits in descending order: * rikn00 * kanikaa1234 * haitaka +* Nick Ginther * Michael Ilsaas * Martin Zimmermann * Brian Jackson @@ -194,7 +195,6 @@ Contributors, sorted by the number of commits in descending order: * Ismail * Samir Benmendil * Regina Hug -* Nick Ginther * Mathias Fussenegger * Marcelo Santos * Jan Verbeek