Merge remote-tracking branch 'origin/pr/3468'

This commit is contained in:
Florian Bruhin 2018-01-10 09:35:28 +01:00
commit b2ed0c0081
2 changed files with 4 additions and 2 deletions

View File

@ -87,8 +87,6 @@ class Completer(QObject):
# cursor on a flag or after an explicit split (--)
return None
log.completion.debug("Before removing flags: {}".format(before_cursor))
before_cursor = [x for x in before_cursor if not x.startswith('-')]
log.completion.debug("After removing flags: {}".format(before_cursor))
if not before_cursor:
# '|' or 'set|'
log.completion.debug('Starting command completion')
@ -99,6 +97,9 @@ class Completer(QObject):
log.completion.debug("No completion for unknown command: {}"
.format(before_cursor[0]))
return None
before_cursor = [x for x in before_cursor if not x.startswith('-')]
log.completion.debug("After removing flags: {}".format(before_cursor))
argpos = len(before_cursor) - 1
try:
func = cmd.get_pos_arg_info(argpos).completion

View File

@ -190,6 +190,7 @@ def _set_cmd_prompt(cmd, txt):
(':gibberish nonesense |', None, '', []),
('/:help|', None, '', []),
('::bind|', 'command', ':bind', []),
(':-w open |', None, '', []),
])
def test_update_completion(txt, kind, pattern, pos_args, status_command_stub,
completer_obj, completion_widget_stub, config_stub,