Pierre Pocreau
Pierre Pocreau

Reputation: 88

Sublime text 3 ugly syntax highlighting

I'm learning Ruby and I'm using Sublime Text 3 but I find the syntax highlighting really strange.

For example :

Ugly syntax

Even after setting the syntax to ruby.

Ruby syntax set

I'd like to know if this is normal, or if I need to change something on the users settings or something like that.

Upvotes: 1

Views: 321

Answers (2)

James Eldridge
James Eldridge

Reputation: 41

You could visit https://packagecontrol.io/ and use something like Railscast Colour Scheme

The basic syntax highlighting that comes w/ sublime is pretty sparse - these packages usually do a better job. Also this is just one example. There's plenty of themes and color schemes.

To install package control ctrl+ and past in the snippet according to your version of sublime from this page https://packagecontrol.io/installation#st3

Upvotes: 1

cremno
cremno

Reputation: 4927

The syntax file for Ruby (Ruby.sublime-syntax) contains a list of unresolved issues. Among them is:

      text:
      "p << end
      print me!
      end"
      symptoms:
      not recognized as a heredoc
      solution:
      there is no way to distinguish perfectly between the << operator and the start
      of a heredoc. Currently, we require assignment to recognize a heredoc. More
      refinement is possible.
      • Heredocs with indented terminators (<<-) are always distinguishable, however.
      • Nested heredocs are not really supportable at present

So yeah, it's normal.

Upvotes: 1

Related Questions