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

Add GLSL syntax? #16

Closed
deadfoxygrandpa opened this issue Dec 9, 2014 · 13 comments
Closed

Add GLSL syntax? #16

deadfoxygrandpa opened this issue Dec 9, 2014 · 13 comments
Labels

Comments

@deadfoxygrandpa
Copy link
Owner

@evancz

On a local branch I just added support for GLSL syntax, which I didn't have before. Anything inside a GLSL block gets highlighted according to whichever GLSL syntax highlighting plugin you have installed, if any. If you don't have a GLSL syntax highlighting plugin, it doesn't do any highlighting at all inside a GLSL block. (This is the current behavior even if you do have a GLSL highlighting plugin installed)

Do you think this is a bad idea? I know you don't seem to be a fan of special cases like this, in general...

@evancz
Copy link
Contributor

evancz commented Dec 9, 2014

I think my personal preference is for less, but @kfish has done more work with GLSL in Elm by doing elm-shadertoy so I'd be curious what he thinks.

I feel I could go either way on this one. Perhaps if the open and close symbols were strong, it would feel less confusing. Not really sure.

@deadfoxygrandpa
Copy link
Owner Author

This is what the current behavior always is:
glsl3
This is what my local branch now looks like if you don't have a GLSL plugin installed:
glsl2
And this is what it looks like if you do have a GLSL plugin installed:
glsl

@evancz
Copy link
Contributor

evancz commented Dec 9, 2014

+@johnpmayer

With short shaders like this, I prefer the no color one because it does not make me think there is a new Elm declaration on every line. I think in larger shaders, it'll become more pleasant. @kfish will probably know better, or have some examples to try out in elm-shadertoy.

@deadfoxygrandpa
Copy link
Owner Author

The other thing is, if you don't want the extra highlighting, you could always just not install an extra plugin. GLSL syntax isn't supported by Sublime Text out of the box.

@deadfoxygrandpa
Copy link
Owner Author

I decided to go ahead with this change for now. I like it locally, with the shaders I've been writing. I'm still open to the idea of removing it later.

@johnpmayer
Copy link

I remember using an emacs package which only highlighted the syntax of the
language where your cursor was. Normally, html would be highlighted and
Javascript would be gray. However, if your cursor was within a script tag,
the JavaScript would be highlighted, and the outside html would be gray.

I think it was called multi-html-mode
On Dec 11, 2014 1:45 AM, "Alex Neslusan" notifications@github.com wrote:

Closed #16 #16.


Reply to this email directly or view it on GitHub
#16 (comment)
.

@deadfoxygrandpa
Copy link
Owner Author

I was just thinking that this wouldn't be possible in Sublime Text, but this plugin makes it seem possible with the right tricks! I think it's a pretty cool idea.

@evancz
Copy link
Contributor

evancz commented Dec 11, 2014

Whoa, that'd be pretty cool!

@kfish
Copy link

kfish commented Dec 12, 2014

@evancz I prefer to keep shaders in separate files anyway just to keep that logic separate from the shapes and physics. As a result it's not too confusing to have syntax highlighting on the shader also.

@deadfoxygrandpa
Copy link
Owner Author

@johnpmayer I just got that context-sensitive highlighting thing working in one direction. Now I can gray out GLSL when you're not inside a GLSL block, and restore the highlighting when you are. This is pretty cool.

@deadfoxygrandpa
Copy link
Owner Author

Here it is so far, in animated GIF action:
glsl

@deadfoxygrandpa
Copy link
Owner Author

This is cool. Thanks for the idea, John.
glsl2

@johnpmayer
Copy link

This is legit
On Dec 12, 2014 11:15 AM, "Alex Neslusan" notifications@github.com wrote:

This is cool. Thanks for the idea, John.
[image: glsl2]
https://camo.githubusercontent.com/6a3b934cb66f43cdd953e4a729b7279f11f74e96/687474703a2f2f692e696d6775722e636f6d2f73536b716d37532e676966


Reply to this email directly or view it on GitHub
#16 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants