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

Ruby: highlight `%<modifier>{}` properly #1704

Closed
Defman21 opened this Issue Jun 13, 2016 · 10 comments

Comments

Projects
None yet
2 participants
@Defman21
Contributor

Defman21 commented Jun 13, 2016

Short Summary

Komodo highlights %r(reg ex) as a string, but it's a regex actually. I think Komodo should use the regex color for %r(whatever).

@mitchell-as mitchell-as added this to the Backlog milestone Jun 13, 2016

@mitchell-as mitchell-as self-assigned this Jun 13, 2016

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Jun 13, 2016

The Scintilla lexer would need upgrading.

@Defman21

This comment has been minimized.

Contributor

Defman21 commented Jun 14, 2016

@mitchell-as note:

%r{regex}
%r'regex'
%r!regex!
%r regex

are also valid. I can use almost any character as delimiter.

@Defman21 Defman21 changed the title from %r(reg ex) should be regex, not string (Ruby) to Ruby: highlight `%<modifier>{}` properly Sep 24, 2016

@Defman21

This comment has been minimized.

Contributor

Defman21 commented Sep 24, 2016

  • %q[ ] - Non-interpolated String (except for \\ \[ and \])
  • %Q[ ] - Interpolated String (default)
  • %r[ ] - Interpolated Regexp (flags can appear after the closing delimiter)
  • %i[ ] - Non-interpolated Array of symbols, separated by whitespace (after Ruby 2.0)
  • %I[ ] - Interpolated Array of symbols, separated by whitespace (after Ruby 2.0)
  • %w[ ] - Non-interpolated Array of words, separated by whitespace
  • %W[ ] - Interpolated Array of words, separated by whitespace
  • %x[ ] - Interpolated shell command
  • %s[ ] - Non-interpolated symbol

Any single non-alpha-numeric character can be used as the delimiter (aka [] in examples)

@Defman21

This comment has been minimized.

Contributor

Defman21 commented Oct 4, 2016

Thanks Mitchell! 👍

@Defman21

This comment has been minimized.

Contributor

Defman21 commented Oct 4, 2016

@mitchell-as there are some modifiers missing: (%i, %I, %s). Should I open a new issue for that?

image

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Oct 4, 2016

No, I went ahead and committed '%s' support: 437bf65

%i and %I work for me. You might have to make sure you're rebuilding everything.

@Defman21

This comment has been minimized.

Contributor

Defman21 commented Oct 5, 2016

I did bk build. Looks like it's not enough.

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Oct 5, 2016

You have to clean src/scintilla. Either bk distclean; bk build or rm -r src/scintilla; bk build.

@Defman21

This comment has been minimized.

Contributor

Defman21 commented Oct 5, 2016

Thanks.

@Defman21

This comment has been minimized.

Contributor

Defman21 commented Oct 5, 2016

image

Works now, thanks! :)

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