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

Colon styling in Ruby lexer #1121

Open
TiZ-HugLife opened this issue Jul 6, 2016 · 3 comments
Open

Colon styling in Ruby lexer #1121

TiZ-HugLife opened this issue Jul 6, 2016 · 3 comments

Comments

@TiZ-HugLife
Copy link

TiZ-HugLife commented Jul 6, 2016

I've noticed a peculiarity in regards to how the Ruby lexer styles colons. A literal that starts with a colon is of course a symbol, but colons are used in other contexts as well, most notably for hash literals, like this snippet from the Ruby docs:

options = { font_size: 10, font_family: "Arial" }

If you put this in Geany, it will style the colons as symbol literals and not as operators as it should.

This is more important for the Ruby-like static language Crystal, in which the Ruby lexer is almost totally sufficient--aside from the fact it only supports primary keywords and not secondary, class, or type keywords--where this notation is used for named tuples, as well as for type annotation for functions: def square(n: Int32): Int32

TL;DR: A colon at the start of a word should indicate a symbol literal, but a colon by itself or at the end of a word should be styled as an operator or punctuation.

@b4n
Copy link
Member

b4n commented Jul 6, 2016

Hum, I don't know ruby but IIUC with your example it's the correct behavior, see Scintilla bugs #1006 and 1810, and this mailing list item.

If those aren't right, please report a bug to Scintilla with a link to official Ruby documentation supporting your request, as it would change a current behavior that was introduced on purpose (IIIUC your request).

@TiZ-HugLife
Copy link
Author

Thanks for the information. After I head upstream, should I bring anything back here like a Scintilla bug ID?

@b4n
Copy link
Member

b4n commented Jul 7, 2016

That would be perfect :)

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

No branches or pull requests

2 participants