mirror of
https://github.com/alexpasmantier/television.git
synced 2025-07-29 06:11:37 +00:00
fix(zsh): improve zsh integration inline mode
This commit is contained in:
parent
0cdf65a204
commit
83711f6d30
6
justfile
6
justfile
@ -75,6 +75,12 @@ alias b := build
|
||||
# Build the project in release mode
|
||||
br: (build 'release')
|
||||
|
||||
|
||||
# test the zsh shell completion script in debug mode
|
||||
# Run: `source <(just generate-zsh-completion)` directly in zsh
|
||||
@generate-zsh-completion:
|
||||
eval "$(cargo run -- init zsh | sed 's/tv /.\/target\/debug\/tv /')"
|
||||
|
||||
# Update the project's changelog
|
||||
@update-changelog:
|
||||
echo "Updating changelog..."
|
||||
|
@ -30,6 +30,7 @@ __tv_path_completion() {
|
||||
leftover=${leftover/#\/}
|
||||
[ -z "$dir" ] && dir='.'
|
||||
[ "$dir" != "/" ] && dir="${dir/%\//}"
|
||||
zle -I
|
||||
matches=$(
|
||||
shift
|
||||
tv "$dir" --autocomplete-prompt "$lbuf" --inline --input "$leftover" < /dev/tty | while read -r item; do
|
||||
@ -94,8 +95,8 @@ _tv_shell_history() {
|
||||
|
||||
output=$(history -n -1 0 | tv --input "$current_prompt" --inline $*)
|
||||
|
||||
zle reset-prompt
|
||||
if [[ -n $output ]]; then
|
||||
zle reset-prompt
|
||||
RBUFFER=""
|
||||
LBUFFER=$output
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user