-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
helpers: toLuaObject
fails to escape strings containing '
#71
Comments
A workaround seems to be using double quotes instead of single quotes within the passed string |
Ah, seems to be an issue with using |
@pta2002 I actually have some progress towards this if you'd like me to submit a PR |
For now I'd suggest using |
I'm a bit confused about this part of Specifically I'm not sure I understand what the special case for filtering out |
As far as I can tell, the condition on line 17 is never reached in the current codebase |
Honeslty I genuinely do not remember why I put that there... I'm filtering out nil so code does not end up with a bunch of |
For now it's just a simple fix. I don't really feel comfortable changing much in helpers without some kind of tests to make sure I don't break everything 😅 |
Plugin affected: many
Nixpkgs channel: 22.05
Home-manager version: 22.05
Description
It looks like the issue is
toLuaObject
is usingescapeShellArg
, which doesn't properly handle escaping strings in this situation.https://github.com/pta2002/nixvim/blob/c320be04c82914933fe94f64282e646d97d342d4/plugins/helpers.nix#L23-L25
When given the string
"<cmd>lua require('gitsigns').blame_line{full=true}<cr>"
it outputs
'<cmd>lua require('\''gitsigns'\'').blame_line{full=true}<cr>'
This results in the following error when starting Neovim:
Config
The text was updated successfully, but these errors were encountered: