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

Ensure Haml {} attributes end the contained Ruby #98

Closed
wants to merge 1 commit into from

Conversation

pilaf
Copy link

@pilaf pilaf commented May 29, 2023

This fixes an issue with the Haml syntax highlighter where using curly ({}) Haml attributes with a nested Ruby hash literal would get the syntax highlighter trapped in Ruby mode for the rest of the file.

E.g.:

.example{ data: { foo: 'bar' } }
  %p This should be highlighted as Haml

  # This should not be highligted as Ruby!
  class NorShouldThis
    def nope(); end
  end

Before my change it looked like this:

Screenshot 2023-05-29 at 7 49 23 PM

After my change it looks like this:

Screenshot 2023-05-29 at 7 50 32 PM

This is my first time working with vim syntax files, so I'm not sure if I missed anything important, but so far this is working perfectly for me.

@tpope
Copy link
Owner

tpope commented May 29, 2023

I can't reproduce this. Your Ruby syntax highlighting looks different from mine too. nope should be highlighted and () shouldn't be. Do you have a different Ruby highlighter installed?

@pilaf
Copy link
Author

pilaf commented May 30, 2023

@tpope You were right, I was using a different Ruby syntax highlighter (jlcrochet/vim-ruby) and it didn't occur to me that that could be the cause of the issue. Sorry for taking up your time, I'm closing this PR now.

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

Successfully merging this pull request may close these issues.

2 participants