kisstkondoros / gutter-preview

Other
158 stars 37 forks source link

How to resolve images with spaces? #83

Closed episage closed 4 years ago

episage commented 4 years ago

MacOS takes screenshots with spaces in their name. For example: Screenshot 2020-04-20 at 22.16.56.png.

I can't make gutter-preview preview images with spaces. I tried bash-escaping it, adding single or double quotes.

This specific issue is regarding *.ts files. Example:

image

Is it possible to do it or does it require a PR?

kisstkondoros commented 4 years ago

As you probably learned with the job you've done with the just landed PR :fireworks: :100: this whole extension is built on regular expressions (to be language independent) but it has some limits...

At the moment spaces are not supported in general (except in markdown, thanks to the clever idea of yours!) as it would need some even more clever regular expressions...

If you want to experiment further, a PR is appreciated!

Another approach would be to resolve workspace based images by aquiring all images from the workspace (as I remember there is some vscode api to do such lookups) and keep an up to date copy of this list in the "server" part. If the list of all images are known prior to the lookup, the recognizers could be adjusted (or a new one can be added) to check if the currently processed line contains any of them...

I have no plans in doing explorations in this area anytime soon, but again, PR's are appreciated!