Skip to content
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

%pistol-extra% substitution not working. #56

Closed
meck opened this issue Mar 13, 2021 · 5 comments
Closed

%pistol-extra% substitution not working. #56

meck opened this issue Mar 13, 2021 · 5 comments

Comments

@meck
Copy link

meck commented Mar 13, 2021

I just tried the new functionally for image previewing discovered a small issue.

image/* chafa -s %pistol-extra0%x%pistol-extra1% %pistol-filename%

does not work it produces nothing for %pistol-extra0%x%pistol-extra1% but if i add some spaces:
%pistol-extra0% x %pistol-extra1% it produces the expected output eg. 10 x 20.

@doronbehar
Copy link
Owner

cc @lucas-mior .

@lucas-mior
Copy link
Contributor

That's right, pistol expects to these arguments to be separated from others.
I don't see a simple way to fix this, but until then you should be able to wrap your chafa command inside a script.

@doronbehar
Copy link
Owner

@meck
Copy link
Author

meck commented Mar 19, 2021

Yes, the following roundabout in the configuration seems to work:

image/* sh: size=" %pistol-extra0% x %pistol-extra1% ";size="$(echo -e "${size}" | tr -d '[:space:]')"; chafa -s "${size}" %pistol-filename%

@meck meck closed this as completed Mar 19, 2021
@doronbehar
Copy link
Owner

This is still an issue worth solving, that workaround is too ugly. Something is wrong with:

arg = re.ReplaceAllString(arg, p.Extras[auxInt])

It doesn't replace the strings if they are not separated with space..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants