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

Loaded Gist does not syntax highlight #150

Open
ghost opened this issue Sep 22, 2014 · 9 comments
Open

Loaded Gist does not syntax highlight #150

ghost opened this issue Sep 22, 2014 · 9 comments

Comments

@ghost
Copy link

ghost commented Sep 22, 2014

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.

@rudiedirkx
Copy link

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.

@sergei-kucher
Copy link

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

@N4M3Z
Copy link

N4M3Z commented Mar 3, 2015

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.

@baslie
Copy link

baslie commented Apr 25, 2016

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.

@jhelgert
Copy link

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.

@resting
Copy link

resting commented Jun 19, 2017

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.

@cyberhck
Copy link

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
Copy link

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
Copy link

cyberhck commented Apr 30, 2018

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.

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

Successfully merging a pull request may close this issue.

7 participants