-
Notifications
You must be signed in to change notification settings - Fork 402
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
🚀 [Question] no autocompletion for second path #1167
Comments
Hi @TornaxO7, are you trying to use the completion config files in the delta repo ( If so, the short answer is that the file for The file for And the file for So, if you're using any of those files in On the other hand, if you haven't got any completion special files installed for delta, then I would have thought that your shell would complete file paths in the first and second position by default. (What shell are you using?) Sorry this answer isn't more satisfactory! |
Sorry for my late reply!
Don't worry I prefer to have at least an answer than nothing ^^
I'm using arch linux and installed delta with
I'm using |
|
Just echoing @TornaxO7; I'm in the exact same situation. ZSH and installed via Pacman. |
A workaround I've ended up using for zsh is adding Though you could put it anywhere, as long as zsh references it. I have mine in a special "this fixes zsh issues" file I source ;). I also have a similar issue with lxc/lxd, which I came to a similar solution with. The reason this probably works is that it overrides previous completions? 🤷 Tested and confirms it works on zsh 5.9.x+. MacOS Ventura Apple Silicon works, using latest head from brew (zsh 5.9.0.1-dev (arm-apple-darwin22.6.0)) And tested on zsh 5.9.x on Linux ( |
Finally got around to looking at this a little bit. The following seems to work in my testing so far. This corrects it so that that it expects at most two files and will provide proper completions for both of them. I've only included a small subset of the flag options though since I didn't want to go through the effort (yet) for adding all of them. # Filename: _delta
#compdef delta
_arguments \
'-s[Side-by-side view]' \
'-n[Display line numbers]' \
'-w[Width of the under/over line decorations]' \
'-h[Show help message]' \
'-V[Show version information]' \
'--tabs[Number of spaces to be used in place of tab characters]' \
'--dark[Use colors appropriate for a dark teminal color theme]' \
'--light[Use colors appropriate for a light terminal color theme]' \
'1:filename:_files' '2:filename:_files' |
Thanks @maverick1872, I agree with your comment elsewhere that the automatic completion generation in #1561 seems like the right path forwards. This issue will close when that merges. |
Hi!
delta
needs two paths obviously to get the diff of them. Normally I'm using<tab>
in my shell to get a nice autocompletion for the files. However, the autocompletion only works for the first argument/path but not for the second, is that behaviour expected?Example interaction (how it is)
ls
delta de<tab>
results todelta deletus.txt
butdelta deletus.txt ye<tab>
results todelta deletus.txt ye
.I expected an expansion to
delta deletus.txt yeet.txt
.The text was updated successfully, but these errors were encountered: