Skip to content

Commit

Permalink
Partial suggestion filling for path parts (#1722)
Browse files Browse the repository at this point in the history
* Partial suggestion filling for path parts

This makes the ctrl+right partial suggestion filling take into account path parts, as it does in fish. To be precise, if the user has typed `python /home/l` and has been shown the suggestion `python /home/lgrobol/test.py`, hitting ctrl+right will only partial fill up to `python /home/lgrobol/` instead of  `python /home/lgrobol/test.py` (current behaviour).
  • Loading branch information
LoicGrobol authored Nov 3, 2023
1 parent f1a0a74 commit a3e0699
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/prompt_toolkit/key_binding/bindings/auto_suggest.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _fill(event: E) -> None:
suggestion = b.suggestion

if suggestion:
t = re.split(r"(\S+\s+)", suggestion.text)
t = re.split(r"([^\s/]+(?:\s+|/))", suggestion.text)
b.insert_text(next(x for x in t if x))

return key_bindings

0 comments on commit a3e0699

Please sign in to comment.