From efef588c30102edc9673a01442fe8198c7858576 Mon Sep 17 00:00:00 2001 From: Joakim Reinert Date: Thu, 12 Oct 2017 14:43:22 +0200 Subject: [PATCH] fix lints in completer --- qutebrowser/completion/completer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qutebrowser/completion/completer.py b/qutebrowser/completion/completer.py index aa7f170a9..eaf74f959 100644 --- a/qutebrowser/completion/completer.py +++ b/qutebrowser/completion/completer.py @@ -201,8 +201,9 @@ class Completer(QObject): updates if the text is shorter than completion.min_chars (unless we're hitting backspace in which case updates won't be ignored). """ - cmd, _sep, rest = self._cmd.text().partition(' ') - if (0 < len(rest) < config.val.completion.min_chars and + _cmd, _sep, rest = self._cmd.text().partition(' ') + input_length = len(rest) + if (0 < input_length < config.val.completion.min_chars and self._cmd.cursorPosition() > self._last_cursor_pos): log.completion.debug("Ignoring update because the length of " "the text is less than completion.min_chars.") @@ -212,7 +213,8 @@ class Completer(QObject): "changes.") else: log.completion.debug("Scheduling completion update.") - self._timer.start(config.val.completion.delay if self._last_text else 0) + start_delay = config.val.completion.delay if self._last_text else 0 + self._timer.start(start_delay) self._last_cursor_pos = self._cmd.cursorPosition() self._last_text = self._cmd.text()