add adjustable delay for completion updates
This commit is contained in:
parent
6498273b31
commit
019d66a4c6
@ -196,6 +196,8 @@ class Completer(QObject):
|
|||||||
|
|
||||||
For performance reasons we don't want to block here, instead we do this
|
For performance reasons we don't want to block here, instead we do this
|
||||||
in the background.
|
in the background.
|
||||||
|
|
||||||
|
We delay the update only if we've already input some text.
|
||||||
"""
|
"""
|
||||||
if (self._cmd.cursorPosition() == self._last_cursor_pos and
|
if (self._cmd.cursorPosition() == self._last_cursor_pos and
|
||||||
self._cmd.text() == self._last_text):
|
self._cmd.text() == self._last_text):
|
||||||
@ -203,7 +205,7 @@ class Completer(QObject):
|
|||||||
"changes.")
|
"changes.")
|
||||||
else:
|
else:
|
||||||
log.completion.debug("Scheduling completion update.")
|
log.completion.debug("Scheduling completion update.")
|
||||||
self._timer.start()
|
self._timer.start(config.val.completion.delay if self._last_text else 0)
|
||||||
self._last_cursor_pos = self._cmd.cursorPosition()
|
self._last_cursor_pos = self._cmd.cursorPosition()
|
||||||
self._last_text = self._cmd.text()
|
self._last_text = self._cmd.text()
|
||||||
|
|
||||||
|
@ -656,6 +656,13 @@ completion.web_history_max_items:
|
|||||||
|
|
||||||
0: no history / -1: unlimited
|
0: no history / -1: unlimited
|
||||||
|
|
||||||
|
completion.delay:
|
||||||
|
default: 0
|
||||||
|
type:
|
||||||
|
name: Int
|
||||||
|
minval: 0
|
||||||
|
desc: Delay in ms before updating completions after typing a character
|
||||||
|
|
||||||
## downloads
|
## downloads
|
||||||
|
|
||||||
downloads.location.directory:
|
downloads.location.directory:
|
||||||
|
Loading…
Reference in New Issue
Block a user