Closed deadfoxygrandpa closed 9 years ago
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.
This is what the current behavior always is: This is what my local branch now looks like if you don't have a GLSL plugin installed: And this is what it looks like if you do have a GLSL plugin installed:
+@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.
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.
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.
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 https://github.com/deadfoxygrandpa/Elm.tmLanguage/issues/16.
— Reply to this email directly or view it on GitHub https://github.com/deadfoxygrandpa/Elm.tmLanguage/issues/16#event-205987781 .
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.
Whoa, that'd be pretty cool!
@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.
@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.
Here it is so far, in animated GIF action:
This is cool. Thanks for the idea, John.
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 https://github.com/deadfoxygrandpa/Elm.tmLanguage/issues/16#issuecomment-66794241 .
@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...