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:
Matthias Bussonnier
2019-08-13 07:57:00 -07:00
parent 7ce77b724d
commit 9a3f41e63b

View File

@@ -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