bat
bat copied to clipboard
case insensitive filename completion not working in zsh
When typing bat r<tab>
no completion happens for files starting with capital R
.
The problem in the case statement after the _arguments call in _bat_main https://github.com/sharkdp/bat/blob/9ab378b5dc7fa7835a27a641e51b5c362bf3bb00/assets/completions/bat.zsh.in#L58-L61
Can be "fixed" with disabling the case statement. But I don't know how to fix it properly to keep completion working for language, theme, style.
Maybe it's an intended behavior. In that case the issue report hopefully helps someone else with a workaround.
Maybe @Kienyew or @xzfc can help here? (if you are interested)
@kerma
The completion of filename is provided by zsh's own directive _files
(line 55). Can you provide a brief example directory structure which the problem occurs, because I couldn't reproduce that problem. Maybe we falled into some edge case?
https://github.com/sharkdp/bat/blob/9ab378b5dc7fa7835a27a641e51b5c362bf3bb00/assets/completions/bat.zsh.in#L55-L61
I'm not quite sure is this problem configuration dependent? Maybe we can haev a look on this: https://stackoverflow.com/questions/24226685/have-zsh-return-case-insensitive-auto-complete-matches-but-prefer-exact-matches
I changed '*: :_files'
to '*:-:_files -g "*(.)"'
and tab completion for files started working for me.