GNOME Bugzilla – Bug 316612
Ruby coloration problems
Last modified: 2005-12-30 16:12:17 UTC
Distribution/Version: Ubuntu 5.04 Enter this with Ruby coloration selected and the colors are wrong : a = 1 / 2 b = 2 / 3 # The begining of this line is considered an regular expression =begin # This is considered a multiline comment, but it's wrong : =end # These two keywords must be at the begining of the line Foo = 123 # Foo is a constant but not colored like constants
Created attachment 52357 [details] [review] Fixes proposal * Adds coloration of symbols * Only the first letter of a constant has to be upper case * =begin and =end have to be at the begining of the line * Regular expressions match changed, but it's still wrong * Allows multiple flags to regular expressions Regular expressions are very difficult to distingish with divisions. I think their coloration should be dropped.
Thanks for you patch and sorry for the late reply. I don't know Ruby so I have a couple of questions: - do you think it is possible to fix the lack of coloration of symbols without adding a new class for symbols? I don't want to add a new translatable string since we are string frozen. - Do you think users will complain if we drop regex coloration? The patch looks good.
1. Yes, you can consider symbols like strings 2. Maybe, but you can explain there's no easy way to detect regular expressions in Ruby, especially by using regexps.
You could keep the %r{ ... } syntax, but there are a few problems : * many other symbols also work : %r(...), %r"...", %r$...$, etc. * nested values aren't supported : with %r{ #{2+2} }, the last "}" isn't colored as regex
Fixed in CVS HEAD. I have committed the Michael's patch. As he suggested, I have then dropped regex coloration. 2005-12-30 Paolo Maggi <paolo@gnome.org> * gtksourceview/language-specs/R.lang: s/Quote/Quoted * gtksourceview/language-specs/gtkrc.lang: s/Quote/Quoted * gtksourceview/language-specs/ini.lang: s/Quote/Quoted * gtksourceview/language-specs/ruby.lang: fixed bug #316612 (Ruby coloration problems). Patch by Michael Witrant <mike@lepton.fr>