Remove needless try/catch in on_selection_changed.
This commit is contained in:
parent
52fdad8186
commit
69a3df174d
@ -101,14 +101,9 @@ class Completer(QObject):
|
|||||||
Return:
|
Return:
|
||||||
A completion model.
|
A completion model.
|
||||||
"""
|
"""
|
||||||
if '--' in before_cursor:
|
if '--' in before_cursor or under_cursor.startswith('-'):
|
||||||
|
# cursor on a flag or after an explicit split (--)
|
||||||
return None
|
return None
|
||||||
try:
|
|
||||||
if under_cursor.startswith('-'):
|
|
||||||
# cursor on a flag
|
|
||||||
return None
|
|
||||||
except IndexError:
|
|
||||||
pass
|
|
||||||
log.completion.debug("Before removing flags: {}".format(before_cursor))
|
log.completion.debug("Before removing flags: {}".format(before_cursor))
|
||||||
before_cursor = [x for x in before_cursor if not x.startswith('-')]
|
before_cursor = [x for x in before_cursor if not x.startswith('-')]
|
||||||
log.completion.debug("After removing flags: {}".format(before_cursor))
|
log.completion.debug("After removing flags: {}".format(before_cursor))
|
||||||
|
Loading…
Reference in New Issue
Block a user