+2

Highlight the colon as operator with Ruby 1.9-style hashes

Lance Ivy 12 лет назад обновлен 11 лет назад 2

When both keys and values are symbols, the colors all run together. A simple fix would be to not consume the colon in the regular expression. I was able to accomplish this by changing "(:)(?!:)" to "(?=:)(?!::)", as in:


    <dict>

      <key>captures</key>

      <dict>

        <key>1</key>

        <dict>

          <key>name</key>

          <string>punctuation.definition.constant.ruby</string>

        </dict>

      </dict>

      <key>comment</key>

      <string>symbols</string>

      <key>match</key>

      <string>(?&gt;[a-zA-Z_]\w*(?&gt;[?!])?)(?=:)(?!::)</string>

      <key>name</key>

      <string>constant.other.symbol.ruby.19syntax</string>

    </dict>


I'm unsure where the downvote came from -- could anyone clarify? I've been using this for a while and have found it to be a definite improvement.

Сервис поддержки клиентов работает на платформе UserEcho