Menu

#1392 URL-encoded version of `%file`?

Other
closed-fixed
nobody
None
5
2021-01-19
2021-01-14
No

For PDF-TeX syncing for Visuala Studio Code, it currently uses the arguments:

vscode://file"%file":%line

This is incorrect when %file contains spaces, for example, since it needs to be URL-encoded (e.g., spaces replaced with instances of %20). For now I'm using a URL-encoding command-line utility, as follows, but this is non-ideal (small performance penalty, for one thing).

vscode://file"$(urlencode "%file")":%line

Related

Bugs: #1392

Discussion

  • Alexander Regueiro

    Sorry, I hadn't finished: I was thinking the best solution might be to have a URL-encoded var like "%fileurl" available.

     
    • Christiaan Hofman

      I don't think that's worth it, as it can easily be escaped, as you
      indicate. It is alsi very rare,as virtually all scripts will use paths, as
      command line utiliies virtually always do for files. And I don't see your
      downsides, why a performance hut fir everybody on our code side to avoid
      another one for the very few users like you?

       
      • Alexander Regueiro

        Some considerations:

        1) Visual Studio Code is very popular, I believe one of the two most popular text editors these days. This issue applies to VS Code on multiple platforms. So it’s not really “rare” at all.
        2) The performance hit is in forking out a process, especially on Windows, but also other OSs. There is basically no performance hit in computing the URL-encoded version of a string within a process, since it can be done very efficiently.
        3) There is no bundled or easily available URL encoder command-line program on macOS or Windows (and possibly not Linux either?). I had to write my own. AAs a consequence, this means it is not possible for a VS Code preset to exist.

        On 14 Jan 2021, at 10:15, Christiaan Hofman hofman@users.sourceforge.net wrote:

        I don't think that's worth it, as it can easily be escaped, as you
        indicate. It is alsi very rare,as virtually all scripts will use paths, as
        command line utiliies virtually always do for files. And I don't see your
        downsides, why a performance hut fir everybody on our code side to avoid
        another one for the very few users like you?

        [bugs:#1392] https://sourceforge.net/p/skim-app/bugs/1392/ URL-encoded version of %file?

        Status: unread
        Group: Other
        Created: Thu Jan 14, 2021 01:10 AM UTC by Alexander Regueiro
        Last Updated: Thu Jan 14, 2021 01:11 AM UTC
        Owner: nobody

        For PDF-TeX syncing for Visuala Studio Code, it currently uses the arguments:

        vscode://file"%file":%line
        This is incorrect when %file contains spaces, for example, since it needs to be URL-encoded (e.g., spaces replaced with instances of %20). For now I'm using a URL-encoding command-line utility, as follows, but this is non-ideal (small performance penalty, for one thing).

        vscode://file"$(urlencode "%file")":%line
        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/skim-app/bugs/1392/ https://sourceforge.net/p/skim-app/bugs/1392/
        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions/

         

        Related

        Bugs: #1392

  • Christiaan Hofman

    • Status: unread --> closed-fixed
     
  • Alexander Regueiro

    Does this mean you modified the behaviour? I ddn't see any reply to the points I raised.

     
    • Christiaan Hofman

      Sorry, yes, I did. see the preset setting for VS Code (you may need to re-select it).

       

Log in to post a comment.