mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
add completions to ${...}
This commit is contained in:
parent
97f9766e62
commit
6a3111f334
2 changed files with 5 additions and 3 deletions
|
@ -11,6 +11,8 @@ Current Developments
|
|||
* Added comma literals to subproc mode.
|
||||
* ``@$(cmd)`` has been added as a subprocess-mode operator, which replaces in
|
||||
the subprocess command itself with the result of running ``cmd``.
|
||||
* The ``${...}`` shortcut for ``__xonsh_env__`` now returns appropriate
|
||||
completion options
|
||||
|
||||
**Changed:**
|
||||
|
||||
|
|
|
@ -526,11 +526,11 @@ class Completer(object):
|
|||
expr = subexpr_from_unbalanced(expr, '{', '}')
|
||||
_ctx = None
|
||||
try:
|
||||
val = eval(expr, ctx)
|
||||
val = builtins.__xonsh_execer__.eval(expr, ctx)
|
||||
_ctx = ctx
|
||||
except: # pylint:disable=bare-except
|
||||
try:
|
||||
val = eval(expr, builtins.__dict__)
|
||||
val = builtins.__xonsh_execer__.eval(expr, builtins.__dict__)
|
||||
_ctx = builtins.__dict__
|
||||
except: # pylint:disable=bare-except
|
||||
return attrs # anything could have gone wrong!
|
||||
|
@ -539,7 +539,7 @@ class Completer(object):
|
|||
opts = []
|
||||
for i in _opts:
|
||||
try:
|
||||
eval('{0}.{1}'.format(expr, i), _ctx)
|
||||
builtins.__xonsh_execer__.eval('{0}.{1}'.format(expr, i), _ctx)
|
||||
except: # pylint:disable=bare-except
|
||||
continue
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue