mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
Modified autocompletion to only list a limited amount of matches(use info for full list), color coded it, modified to show both torrent names and ID as well as highlight matching part, show green 'Autocompletion matches' text for more than 4 matches so it's more readable. Depends on previous commit
This commit is contained in:
parent
80b88bf047
commit
508dec4858
1 changed files with 6 additions and 2 deletions
|
@ -57,6 +57,9 @@ import re
|
|||
LINES_BUFFER_SIZE = 5000
|
||||
INPUT_HISTORY_SIZE = 500
|
||||
|
||||
AUTOCOMPLETE_MAX_TORRENTS = 20
|
||||
AUTOCOMPLETE_MAX_TORRENTS_WITH_PATTERN = 10
|
||||
|
||||
class Legacy(BaseMode):
|
||||
def __init__(self, stdscr, console_config, encoding=None):
|
||||
|
||||
|
@ -631,10 +634,11 @@ class Legacy(BaseMode):
|
|||
#If we only matched one torrent, don't add the full name or it'll also get autocompleted
|
||||
if match_count == 1:
|
||||
if torrent_id.startswith(line):
|
||||
possible_matches.append(torrent_id + " ")
|
||||
possible_matches.append(torrent_id)
|
||||
break
|
||||
if torrent_name.startswith(line):
|
||||
possible_matches.append(escaped_name + " ")
|
||||
self.write(escaped_name)
|
||||
possible_matches.append(escaped_name)
|
||||
break
|
||||
else:
|
||||
l = len(raw_line)
|
||||
|
|
Loading…
Add table
Reference in a new issue