doronbehar / pistol

General purpose file previewer designed for Ranger, Lf to make scope.sh redundant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

%pistol-extra% substitution not working.

meck opened this issue · comments

commented

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.

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.

commented

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%

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..