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

Ruby 2.1 Required Keyword Args not Highlighted Correctly #193

Closed
smackesey opened this issue Jan 16, 2014 · 4 comments
Closed

Ruby 2.1 Required Keyword Args not Highlighted Correctly #193

smackesey opened this issue Jan 16, 2014 · 4 comments
Labels

Comments

@smackesey
Copy link

1389852672

AndrewRadev added a commit that referenced this issue Feb 23, 2014
These are highlighted as symbols, but only if they're followed by a
space. If they're followed with a comma, like in:

    def one(two:, three:)
    end

Then the "two:" would not be highlighted.

See #193.
@AndrewRadev
Copy link
Member

I've pushed a commit that should fix this. Could you try it out and see if it works?

For future reference, it would help if you would also paste a code sample along with the screenshot to make it slightly easier to copy-paste and test :).

@tpope, @dkearns, the commit is 9080349, and it changes one line 104. Line 106 looks very similar to that one, but I didn't make the change there, since I couldn't figure out if it's necessary. I tried some examples, but the fix on 104 seems to fix any combination I can think of. Could any of you give me a good example of what line 106 would be used for? I'm wondering if is used at all since the different parts are:

  • []})\"':]\@<!
  • [[:space:],{(]

And it seems like the first one is a superset of the second one. Or am I missing something?

@tpope
Copy link
Member

tpope commented Feb 23, 2014

I think it was just a compromise to get the highlighting to kick in as soon as the colon is typed as often as possible, without inviting false positives.

@AndrewRadev
Copy link
Member

Ah, I see. Well, I'll put the [[:space:],{(] in there just to keep it synced with the above one.

@smackesey
Copy link
Author

@AndrewRadev thanks, that fixed it. Next time I encounter something I will post a code sample as well as image.

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

No branches or pull requests

3 participants