In Lua 5.5 you can no longer reassign for-loop variables, f.e.
```lua
for k, v in pairs(tbl) do k = "foobar" end
```
This PR should fix this problem
Signed-off-by: botantony <antonsm21@gmail.com>
In skywind3000/z.lua#122 there's a note that z.lua intentionally doesn't
support `z -i` being interactive to maintain consistency with how z.sh
behaves with `z -i`. But z.sh doesn't have a `-i` option, so I'm not
sure what is the intent.
This commit makes `z -i` and `z -I` go interactive even with no args.
The fzf interactive mode (`-I`) constructs a `tmpname` pathname and
tries to sanitize it by stripping all `\` characters. But it missed
stripping all `:` characters, and the command printed this error output:
The filename, directory name, or volume label syntax is incorrect.
The `tmpname` looked like "c:\tmp\Temp\zlua_c:tmpTempsh2k0.txt", and
the embedded `:` caused the error output.
This commit adds `:` to the list of characters to be stripped (only on
Windows).
Using '|' as the data separator caused crashes if
a path with a '|' char in it was in the data file.
Changing that separator to a null byte ensures
that this kind of issue can never happen again as
the null byte can't be in a path.
- Introduced new environment variable _ZL_ZSH_FZF to specify the fzf command
- Updated the eval statement to use the custom fzf command if provided by the user
Previously, you needed to set `_ZL_HYPHEN=1` to treat `-` as a normal
character. Otherwise, it was treated as a Lua regexp special character, see
https://www.lua.org/pil/20.2.html. Note that it is not super-useful to treat
`-` as a special character; it is almost the same as `*` and the difference
is not very useful in the context of fuzzy matching.
Now, if `_ZL_HYPHEN` is not set, z.lua first tries to treat it as a regexp
character. If there are no results (which is likely if the user does not know
it's a special character), z.lua tries again, treating `-` as a normal
character this time.
If `_ZL_HYPHEN=0` or `_ZL_HYPHEN=1`, z.lua will always treat `-` as
either a regex symbol or as a normal character (respectively).
Hopefully, this will make the FAQ at
https://github.com/skywind3000/z.lua/wiki/FAQ#how-to-input-a-hyphen---in-the-keyword-
unnecessary. It took me weeks to look into the question of why `z
home-manager` refused to work and to find that FAQ.
I only tested this briefly, but it seems to work.