-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autocomplete: assume selection when there's only one candidate #277
base: main
Are you sure you want to change the base?
Conversation
2f32a8d
to
b64724c
Compare
b64724c
to
b952351
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall.
Just a few minor comments
@@ -248,7 +248,6 @@ impl std::str::FromStr for Command { | |||
} else if command == CMD_DELETE_FILES { | |||
let (mut permanently, mut background) = (false, false); | |||
for arg in arg.split_whitespace() { | |||
eprintln!("arg: {:?}", arg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, thanks for catching this!
@@ -265,7 +265,7 @@ case "$mimetype" in | |||
esac | |||
``` | |||
|
|||
`~/.config/joshuto/on_preview_removed.sh`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both references to this script above ("Configuring Hook Scripts" and "The Hook Scripts") don't have the .sh. I blindly copy-pasted those instructions, but with the kitty modifications, but it took me a couple minutes to identify the typo.
@@ -215,6 +215,10 @@ impl<'a> TuiTextField<'a> { | |||
let _ = terminal.hide_cursor(); | |||
return None; | |||
} | |||
Key::Ctrl('c') => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
This makes autocomplete behave like how it works in ranger. To test before and after, create a directory long directory chain
$HOME/foo/bar/baz
, type:cd fo
and press Tab several times. Previously, joshuto would stop atfoo
, but now the first Tab will autocompletefoo/
, the second will autocompletefoo/bar/
, and so on.I don't know any Rust, but the change seems to work. Feel free to cherry pick the commit and make changes to make it more idiomatic/cleaner/whatever.
The PR also includes a couple of other trivial improvements.