[Feature request] Support `ignorecase false` and `smartcase` at same time
Currently, the smartcase only available when ignorecase true. However, I hope the smartcase can work with ignorecase false.
I'm not sure what you mean here. smartcase forces matching to be case-sensitive if the pattern contains an uppercase character, so if ignorecase is disabled then the matching is already case-sensitive and there is nothing for smartcase to do.
Sorry, I will clearify my thought.
I want lf don't ignore case when sorting, but ignore case when searching...
So I hope the ignorecase and smartcase can be independent.
Okay I see, so the problem isn't to do with smartcase, it's to do with the fact that ignorecase affects both sorting and searching. I think users normally expect the behavior to be the same (either both case-sensitive, or both case-insensitive) for both sorting and searching, but you can try sorting by a custom method, see #618 for more details.
EDIT: You can try something like below, I only tested it briefly though.
# uncomment for debugging
# set info custom
set sortby custom
cmd on-load &{{
cmds() {
find "$(dirname "$1")" -mindepth 1 -maxdepth 1 \
| LC_ALL=C sort \
| nl -n rz -s '|' \
| while IFS='|' read -r index file; do
printf 'addcustominfo "%s" "%s"; ' "$file" "$index"
done
}
lf -remote "send $id :$(cmds "$@")"
}}