mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Complete path after ~.
Note this is mostly to discuss as if I understood one of your message on
Twitter, this was not possible without fuzzy completion.
I tried with just this patch and that works great.
Note that unlike IPython that right now does :
~/<tab> -> /Full/Path/to/user/home
But with this patch this just complete things correctly without
expanding the tab. And I think not expanding the tab is actually better.
Anyway, open that to better understand the why you were waiting for
fuzzy completion.
This commit is contained in:
@@ -37,6 +37,8 @@ def file_name_completions(evaluator, module_context, start_leaf, string,
|
|||||||
like_name_length = len(os.path.basename(string) + like_name)
|
like_name_length = len(os.path.basename(string) + like_name)
|
||||||
|
|
||||||
addition = _get_string_additions(module_context, start_leaf)
|
addition = _get_string_additions(module_context, start_leaf)
|
||||||
|
if string.startswith('~'):
|
||||||
|
string = os.path.expanduser(string)
|
||||||
if addition is None:
|
if addition is None:
|
||||||
return
|
return
|
||||||
string = addition + string
|
string = addition + string
|
||||||
|
|||||||
Reference in New Issue
Block a user