mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
completer: Fix crash in completer
Fixed crash when completing the 'completer' command and the cursor is inside a word I.E. 'completer some<TAB>thing'
This commit is contained in:
parent
1b7892186a
commit
b7bba551e1
1 changed files with 7 additions and 0 deletions
|
@ -8,7 +8,14 @@ def complete_completer(prefix, line, start, end, ctx):
|
|||
args = line.split(" ")
|
||||
if len(args) == 0 or args[0] != "completer":
|
||||
return None
|
||||
|
||||
if end < len(line) and line[end] != " ":
|
||||
# completing in a middle of a word
|
||||
# (e.g. "completer some<TAB>thing")
|
||||
return None
|
||||
|
||||
curix = args.index(prefix)
|
||||
|
||||
compnames = set(builtins.__xonsh__.completers.keys())
|
||||
if curix == 1:
|
||||
possible = {"list", "help", "add", "remove"}
|
||||
|
|
Loading…
Add table
Reference in a new issue