Closed Kethku closed 3 years ago
Ah that sucks! Well done for spotting it though! I should really try to get my test suites running on Windows (and ARM actually...), it's definitely a platform I neglect as a *nix centric developer. I try to avoid using anything that doesn't seem portable, so I hope issues with Windows are always small easy fixes. Neovim and LibUV are great cross platform foundations 😄
Looks like #48 will do the trick though, I'll merge and compile that for you then we can see if it helps.
So, let me know if the issue is fixed for you on develop
😄 hopefully that does the trick!
I'll optimistically close in the hopes that the gsub fixed the issue, if not, please do reopen!
Is this the same error? On linux and macOS, the config is working. While on Windows, I get this ambiguous error. I have changed endline from \r\n to \n but still no difference. Strangely, the error indicator is showing at the "." dot character.
Explanation:
filename
is propagated into fennel parsing string literal. Thus, the backslash is parsed as escaping the next character, which is illegal (\i \l \p \s
).
Resolve:
An easy fix is to replace the backslash with forward slash. Below, I demonstrate how and where it should be fixed. If there is a better place to employ the fix, you can tell me to test it out.
Below is the code I fixed directly on lua:
-- compile.lua
local _3_ = a.get(opts, "filename")
if _3_ then
filename = string.gsub(_3_, (nvim.fn.getcwd() .. "/"), "")
else
filename = _3_
end
filename = string.gsub(filename, "\\", "/")
Fennel code reference: https://github.com/Olical/aniseed/blob/4ca3d418eebc0da452b7defc18970c83f7de5070/fnl/aniseed/compile.fnl#L9-L12
Is this working for you now on develop
and the soon to be released version? @nganhkhoa
I confirm the compilation success on the develop
branch.
Seems like something broke since I last tried to compile my vim config with aniseed.
When I recompiled my config I got:
So I searched on the fennel repo for similar errors and found: https://github.com/bakpakin/Fennel/issues/357
Which told me that the error I was running into was likely due to a character escape issue. So I looked in the fennel.lua file and added a print line which revealed among other things, this string: "C:\Users\keith\AppData\Local\nvim/fnl\init.fnl"
I believe this comes from the stdpath(config) call. However becomes I'm on windows I'm not able to recompile aniseed (or don't know how) given that they are shell scripts. I think the backslashes need to be converted to forward slashes in env.fnl. Any clues as to how to fork and recompile on windows os I can fix this issue?