Closed gene-pavlovsky closed 4 years ago
Hi @gene-pavlovsky ,
In fact, after some tests, this bug seems directly related to the use of -V
options without using -d
.
No sort options, the results is ok
$ listing=("/etc/" "/home/" "/opt/" "/private/" "/sbin/" "/tmp/" "/usr/" "/var/" "/.VolumeIcon.icns" "/.file" "/.DS_Store" "/.fseventsd/" "/.vol/")
$ printf '%s\0' "${listing[@]}" | current_cmd_name=test current_sort_opts='' __fzf_obc_sort | __fzf_obc_move_hidden_files_last | tr '\0' '\n'
/etc/
/home/
/opt/
/private/
/sbin/
/tmp/
/usr/
/var/
/.DS_Store
/.VolumeIcon.icns
/.file
/.fseventsd/
/.vol/
Using only -V
, the result is the same as you described
$ printf '%s\0' "${listing[@]}" | current_cmd_name=test current_sort_opts='-V' __fzf_obc_sort | __fzf_obc_move_hidden_files_last | tr '\0' '\n'
/etc/
/home/
/opt/
/private/
/sbin/
/tmp/
/usr/
/var/
/.VolumeIcon.icns
/.file
/.DS_Store
/.fseventsd/
/.vol/
Using -Vd
the result is ok
printf '%s\0' "${listing[@]}" | current_cmd_name=test current_sort_opts='-Vd' __fzf_obc_sort | __fzf_obc_move_hidden_files_last | tr '\0' '\n'
/etc/
/home/
/opt/
/private/
/sbin/
/tmp/
/usr/
/var/
/.DS_Store
/.VolumeIcon.icns
/.file
/.fseventsd/
/.vol/
I think i will set sort_opts to "" in the next release.
Could you test by setting std_sort_opts to "" or "-Vd" and close this issue if it works as you would like ?
Regards,
Indeed, "-Vd" produces the results you mentioned. I wonder why is that option necessary... Thanks for looking into this.
In fact, i'm thinking that using options as -V -i -d
is the real problem here and will be best to use them only in precise context.
This is for the same reason i will set sort_opts="" in next release.
In my previous example with -Vd
, the result is correct because you use std_filedir_hidden_first='0'
.
If you don't use it, since -d
ignore non alphanumeric, you will see that the order is not the one expected
$ printf '%s\0' "${listing[@]}" | LC_ALL=C sort -z | tr '\0' '\n'
/.DS_Store
/.VolumeIcon.icns
/.file
/.fseventsd/
/.vol/
/etc/
/home/
/opt/
/private/
/sbin/
/tmp/
/usr/
/var/
$ printf '%s\0' "${listing[@]}" | LC_ALL=C sort -z -V | tr '\0' '\n'
/.VolumeIcon.icns
/.file
/etc/
/home/
/opt/
/private/
/sbin/
/tmp/
/usr/
/var/
/.DS_Store
/.fseventsd/
/.vol/
$ printf '%s\0' "${listing[@]}" | LC_ALL=C sort -z -Vd | tr '\0' '\n'
/.DS_Store
/.VolumeIcon.icns
/etc/
/.file
/.fseventsd/
/home/
/opt/
/private/
/sbin/
/tmp/
/usr/
/var/
/.vol/
default.cfg:
Dot files are shown after regular files, as expected. Regular files are sorted as expected. Dot files, however, appear to be unsorted.
Screenshot: