From 92381358678f478ccf3dc06331e476ca11e693a4 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 25 Jun 2014 16:48:28 +0200 Subject: [PATCH] Fix crashes after completion refactoring --- qutebrowser/utils/completer.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/qutebrowser/utils/completer.py b/qutebrowser/utils/completer.py index 00d3a1a3f..3604673f8 100644 --- a/qutebrowser/utils/completer.py +++ b/qutebrowser/utils/completer.py @@ -178,14 +178,16 @@ class Completer(QObject): return model = self._get_new_completion(parts, cursor_part) - if model is None: - logger.debug("No completion model for {}.".format(parts)) - if model != self.view.model(): - self.view.hide() - return if model != self.view.model(): - self.view.set_model(model) + if model is None: + self.view.hide() + else: + self.view.set_model(model) + + if model is None: + logger.debug("No completion model for {}.".format(parts)) + return pattern = parts[cursor_part] if parts else '' self.view.model().pattern = pattern