Skip to content

Use sublime stylus plugin for embedded stylus code #38

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

Merged
merged 1 commit into from
Apr 1, 2016

Conversation

jpokrzyk
Copy link
Contributor

Stylus needs slashy comments, like this:
// font-family 'Roboto', 'Helvetica', sans-serif

The old files made sublime produce html comments, like this:

<!-- font-family 'Roboto', 'Helvetica', sans-serif -->

It looks like those file patterns somehow match to the regular stylus plugin for sublime. The way it was, sublime looked for a a plugin called vue-stylus, which doesn't exist, so it reverted to using html comments.

This only affected the comments. The syntax highlighting was still working fine. But the stylus plugin is definitely required for both the highlighting and commenting to work.

@yyx990803
Copy link
Member

I believe this was changed deliberately to fix #8. Can you test and see if reverting it would cause that bug again?

@jpokrzyk
Copy link
Contributor Author

Yea this causes the enter key not to work as mentioned in billymoon/Stylus#70

I would say https://github.com/billymoon/Stylus is to blame since the embedded vue less and embedded vue sass stuff works fine with their plugins.

I spent a good couple of hours on this and couldn't figure it out. I'm 95% it's not the comment sections in the stylus.tmLanguage file. Even if you remove all the comment stuff it's still an issue. There must be some greedy regex that's also matching to the comment pattern or something like that. I give up.

@jpokrzyk jpokrzyk closed this Mar 13, 2016
@jpokrzyk jpokrzyk reopened this Mar 13, 2016
@jpokrzyk
Copy link
Contributor Author

This seems to work. It's a pretty big hack and confusing. I probably wouldn't merge it. But I figured I would just throw it up here. You need the sublime sass plugin installed. But it seems to highlight and comment embedded stylus fine.

@azamat-sharapov Take a look at this if you're interested. I'm sure you end up losing some stylus stuff if you do this though. I haven't found any negative side effects yet.

@jpokrzyk jpokrzyk closed this Mar 22, 2016
@jpokrzyk jpokrzyk reopened this Mar 31, 2016
@jpokrzyk
Copy link
Contributor Author

Opening this back up after the fix here: billymoon/Stylus#70

Thanks for fixing this @grassator!

@yyx990803
Copy link
Member

@jpokrzyk wow nice, thanks for getting it fixed over there - can you update this PR to use proper stylus instead of sass though?

@jpokrzyk jpokrzyk changed the title Fix sublime inserting HTML comments into stylus section Use sublime stylus plugin for embedded stylus code Mar 31, 2016
@jpokrzyk
Copy link
Contributor Author

@yyx990803 Ha whoops. Good catch. How does this look.

@yyx990803 yyx990803 merged commit 15b0a7f into vuejs:master Apr 1, 2016
@yyx990803
Copy link
Member

Sweet, thanks for looking into this!

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