Closed dbromby closed 11 years ago
It looks like this is caused by the division sign (/) rather than the actual ternary operator. We'll take a look at it, thanks :)
Here's another ternary operation that appears to break it too. If you remove the "?" the format looks fine.
${ ( var1 > var2 ? 'some text' : 'some more text' ) }
This sample looks fine for me. Can you check that the file is displaying as "Grails Server Page (GSP)" and let us know what color scheme you are using?
Hm yes, that does seem OK. Maybe there was something else going on in the file in question. I'll double check.
The only reproducible issue right now is using division in the ternary operator.
BTW - I'm using the Twilight theme.
Any plans to fix the issue caused by "/" ?
I've taken a look at it, and it turns out that the groovy plugin's syntax
highlighter is marking the text after the "/" as a regular expression.
Groovy allows regular expressions to be written /regex/, and it is
detecting "
On Thu, May 23, 2013 at 12:26 AM, dylanbromby notifications@github.comwrote:
Any plans to fix the issue caused by "/" ?
— Reply to this email directly or view it on GitHubhttps://github.com/osoco/sublimetext-grails/issues/4#issuecomment-18312220 .
I'm seeing highlighting errors with the following snippet:
<%= a.b == null ? "" : a.b.c %>
As soon as I remove the ? the highlighting works wonderfully!
Sadly, that's not going to resolve my problem. Also, every theme I have installed (just the ones that come with the default install) are all affected by this. The theme I'm currently using is the Espresso Libre.
I'm currently trying to re-write the entire syntax highlighting rules, so I will add this case to my test file. I'm not too sure what trouble you are seeing though. For me, the only thing that doesn't show right when the ? is present is the final %>. Is it the same for you? If not, where in the page does your sample appear? (directly in the body, as a tag attribute, etc). Thanks!
On Tue, Oct 15, 2013 at 7:27 AM, hayseed notifications@github.com wrote:
I'm seeing highlighting errors with the following snippet:
<%= a.b == null ? "" : a.b.c %>
As soon as I remove the ? the highlighting works wonderfully!
Sadly, that's not going to resolve my problem. Also, every theme I have installed (just the ones that come with the default install) are all affected by this. The theme I'm currently using is the Espresso Libre.
— Reply to this email directly or view it on GitHubhttps://github.com/osoco/sublimetext-grails/issues/4#issuecomment-26310155 .
Ok, annoyingly I'm now seeing two different results from two different .gsp files. One is the main layout file and the other is one of the views.
Both instances have the ternary operator as part of the body of the file. I have attached two screenshots of the the behaviour I'm seeing.
On Tuesday, 15 October 2013 6:36:14 PM, gcrick wrote:
I'm currently trying to re-write the entire syntax highlighting rules, so I will add this case to my test file. I'm not too sure what trouble you are seeing though. For me, the only thing that doesn't show right when the ? is present is the final %>. Is it the same for you? If not, where in the page does your sample appear? (directly in the body, as a tag attribute, etc). Thanks!
- Geli
Ok, thanks for the screenshots, hopefully that'll let me duplicate the problem. Oh, the joys of regular expressions! ;)
On Wed, Oct 16, 2013 at 2:08 AM, hayseed notifications@github.com wrote:
Ok, annoyingly I'm now seeing two different results from two different .gsp files. One is the main layout file and the other is one of the views.
Both instances have the ternary operator as part of the body of the file. I have attached two screenshots of the the behaviour I'm seeing.
On Tuesday, 15 October 2013 6:36:14 PM, gcrick wrote:
I'm currently trying to re-write the entire syntax highlighting rules, so I will add this case to my test file. I'm not too sure what trouble you are seeing though. For me, the only thing that doesn't show right when the ? is present is the final %>. Is it the same for you? If not, where in the page does your sample appear? (directly in the body, as a tag attribute, etc). Thanks!
- Geli
—
Reply to this email directly or view it on GitHubhttps://github.com/osoco/sublimetext-grails/issues/4#issuecomment-26383404 .
I think these problems should be fixed in the latest version (1.0.1). Please re-open if you still see the issues after updating.
They're not fixed - that's why I emailed you.
Sent from my iPhone
On Oct 20, 2013, at 10:26 AM, gcrick notifications@github.com wrote:
I think these problems should be fixed in the latest version (1.0.1). Please re-open if you still see the issues after updating.
— Reply to this email directly or view it on GitHub.
I'm sorry you are still having trouble. I didn't receive any email, so I'm not sure if I'm missing some details. I just checked, and you are right that your original case (
Ok, I think I got it fixed this time!
I just took a look at our codebase and so far this looks good - thank you!
Generate additional income renting on eRENT.com.
Dylan Bromby Co-Founder dylan@eRENT.com
eRENT.com twitter.com/eRENT facebook.com/eRENT
On Oct 25, 2013, at 8:39 AM, gcrick notifications@github.com wrote:
Closed #4.
— Reply to this email directly or view it on GitHub.
Really appreciate your commitment to this - the aesthetics of code formatting are so important to workflow!
-- Dylan
Generate additional income renting on eRENT.com.
Dylan Bromby Co-Founder dylan@eRENT.com
eRENT.com twitter.com/eRENT facebook.com/eRENT
On Oct 25, 2013, at 8:39 AM, gcrick notifications@github.com wrote:
Ok, I think I got it fixed this time!
— Reply to this email directly or view it on GitHub.
You're welcome :) Sorry it took me so long to get it fixed!
On Fri, Oct 25, 2013 at 6:06 PM, dylanbromby notifications@github.comwrote:
Really appreciate your commitment to this - the aesthetics of code formatting are so important to workflow!
-- Dylan
Generate additional income renting on eRENT.com.
Dylan Bromby Co-Founder dylan@eRENT.com
eRENT.com twitter.com/eRENT facebook.com/eRENT
On Oct 25, 2013, at 8:39 AM, gcrick notifications@github.com wrote:
Ok, I think I got it fixed this time!
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHubhttps://github.com/osoco/sublimetext-grails/issues/4#issuecomment-27104757 .
Hmm, looks like I'm having issues again with the highlighting. The following is what's causing the problems of the syntax 'bleeding'. It's the second ? that's causing the bleed problem. I am using ST2 (build 2221) and v1.0.3 of the plugin.
${one?.two?}
Edit: Now my illustrious colleagues tell me to remove the second ? and she'll be apples. Honestly. Apologies for opening this up again! :D
Thanks for keeping your eyes open anyway hayseed. Yeah, as far as I know, leaving a ? at the end of an expression isn't valid Groovy syntax. In theory, I could mark it as an error so that it stands out with special highlighting, but given the way syntax highlighting works in sublime and the number of possible error cases, it really isn't practical.
I do believe I've discovered another one (and the syntax is correct this time!).
<g:each in="${schedules.groupBy{it.lcRequest}.sort{it.key.title}}" var="request">
Screenshot included to show where it's looking funky.
That does look bad. It looks fine to me in my normal working setup, but I'll look into it further. I've created a new issue to track it: #13. Thanks!
The following ternary operation breaks formatting:
<g:formatNumber number="${val1 == 0 ? 0 : val2 / val3}" type="percent" />