gist icon indicating copy to clipboard operation
gist copied to clipboard

Loaded Gist does not syntax highlight

Open ghost opened this issue 11 years ago • 9 comments

Hi, I've just created my new workflow with Gist and my TODO lists. I am using PlainTasks plugin for handling lists, but when I load that todo file from Gist it is not syntax highlighted by default and i have to change highlight manualy.

Is this an issue of Gist plugin?

Thanks in advance. Biosek.

ghost avatar Sep 22 '14 19:09 ghost

Same here. I loaded a JSON (filename is BR.sublime-completions though) and the syntax hiliting is Plain text. If I load the file myself, ST somehow detects JSON.

rudiedirkx avatar Sep 22 '14 22:09 rudiedirkx

Same problem on Sublime Text 3. Seems like package fail to set any syntax then gist is loaded.

sergei-kucher avatar Nov 22 '14 14:11 sergei-kucher

Same here, I am getting this error message:

error: Error loading syntax file "Packages/Shell/Shell.tmLanguage": Unable to open Packages/Shell/Shell.tmLanguage

Selecting the syntax manually works fine.

N4M3Z avatar Mar 03 '15 17:03 N4M3Z

The same problem on my Windows 7 machine. I've got an error on loading Gist file with plain text:

Unable to open Packages/Text/Text.tmLanguage

I solved that by creating a new one folder in my Package directory.

baslie avatar Apr 25 '16 09:04 baslie

I am also struggling with this problem. Is there any chance for a fix or did anyone find a way to get it work? Would be really appreciated.

jhelgert avatar Jan 28 '17 18:01 jhelgert

Having this error too.

Error loading syntax file "Packages/Shell/Shell.tmLanguage": Unable to open Packages/Shell/Shell.tmLanguage

Have to manually set the syntax for syntax highlighting.

resting avatar Jun 19 '17 05:06 resting

is there anything being done in this issue? this is a very pain point for me, I use for plain task, and I wish I didn't have to do this every single time.

cyberhck avatar Apr 30 '18 02:04 cyberhck

I did some debugging, and turns out this is problem: https://github.com/condemil/Gist/blob/2eabc3f3cf853014a9b3f3ee17fca8f0e76bdc89/gist_60_helpers.py#L96-L97

Github doesn't treat .todo files as any language, and this actually tries not to set language. And I think that's the problem.

I think we should query sublime text to see what syntax should it use to handle those file types in case language is set to None.

I'll try to file a PR later when I have time IF I manage to get this working.

cyberhck avatar Apr 30 '18 03:04 cyberhck

I did find a way to get this working BUT it's not very clean. Turns out there's no way to get syntax by extension as mentioned here We'd either have to parse all settings file (including inside sublime-package files), or use a dirty hack to get syntax. (I went for lazy method) basically I create a temp file inside /tmp, open file, get syntax, close file immediately. then set the syntax.

here's a PR (#188) which is working on my machine.

cyberhck avatar Apr 30 '18 04:04 cyberhck