diff options
author | Rory Dudley | 2024-09-30 21:55:39 -0600 |
---|---|---|
committer | Rory Dudley | 2024-09-30 23:02:10 -0600 |
commit | a513f1ec2036f8f52fb4d5bd720974a8e06d1074 (patch) | |
tree | 11078742d8ccb0c2a4183689e03493c0b0e8bb9d /src/git@git.dwarvish.org:dwarvish.git | |
parent | 3f1b5f03a34ff0d8e3d616fefc412691d615c3ed (diff) | |
download | dwarvish-a513f1ec2036f8f52fb4d5bd720974a8e06d1074.tar.gz |
Expand filepath autocomplete
This patch expands upon the last one, by providing a filepath
autcomplete routine, which works more similarly to that of zsh or bash.
It works for:
- Any paths containing the current directory (`.`)
- Any paths containing the parent directory (`..`)
- Any paths containing the root directory (`/`)
- Any paths that don't contain any explicit directory (defaults to the
current directory, i.e. `.`)
In order to achieve this, the pwd (present working directory) was broken
out from the autocomplete() function, and is now recomputed every time a
character is typed (in the getline() function). pwd always starts off as
the current directory, but may change based off of user input. If the
current directory cannot be read (likely due to a permissions issue),
dwvsh defaults to the user's home directory for now.
The filepath autocomplete also works for paths with mutliple directories
now (i.e. /etc/mail/xxx), will still allow you to autocomplete files and
directories beginning with 'xxx' inside the '/etc/mail' directory.
It is also possible to use the tilda character (`~`) with the filepath
autocomplete now (it denotes the user's home directory, for instance,
autocomplete works for '~/.config/').
Finally, some logic for Shift+Tab was added to autocomplete. It works
the same as Tab, except runs backwards through the files and directories
(as opposed to forwards).
Signed-off-by: Rory Dudley <rory@netc.lu>
Diffstat (limited to 'src/git@git.dwarvish.org:dwarvish.git')
0 files changed, 0 insertions, 0 deletions