Closed ryaminal closed 2 years ago
I've test this and it fixed my issues.
@ryaminal, thanks for fixing this.
For context about how this bug snuck in is 50% my fault ;) caused by my lack of due diligence to add Zunit tests.
For the other half and how I tried to avoid this issue (logic change in style changes), I apply formatting via the following process:
ggrep -E '^[\:\.\+\_\@]z.*[-_].*[[:space:]]*()*' ${FILE_TO_PARSE} \
| tr -d \(\) \
| awk '{print $1}' \
| xargs > TMP_FORMAT_${FILE_TO_PARSE}
It will extract a list of functions names (in the same order) which is passed to Zsh for formatting
functions -x 2 ${LIST OF FUNCTIONS} > "FORMATTED_${FILE_TO_PARSE}"
the rest of the process is cleaning up the loops, conditional statements, and reinserting comments.
So, All that to say, thanks for reporting, so I am now aware it isn't a foolproof formatter.
In an attempt to use
if/then
instead of||
stuff in ZSH an error was made.(( ... ))
is for arithmetic and when checking the output of a command this leads to abad floating point constant
error. This, I believe, is due tozsh
interpreting the function.zinit-annex-patch-dl-download-file-stdout
as a float because of the leading.
. See ZSH Arithmetic Evaluation for more information on this. The line of interest states:Description
Remove the
(( ... ))
.Motivation and Context
Example output with the
(( ... ))
See the following output:
The result is that each of those files failed to download(really failed to be written to disk) and then when those files are requested later they don't exist.
Related Issue(s)
Usage examples
How Has This Been Tested?
Output of the load should have no errors. Also, when a new shell is loaded there should be no errors about not being able to find the
key-bindings.zsh
file.Types of changes
Checklist: