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

Syntax file in unexpected location #127

Closed
pwntester opened this issue Sep 16, 2020 · 6 comments
Closed

Syntax file in unexpected location #127

pwntester opened this issue Sep 16, 2020 · 6 comments
Assignees
Labels
bug:report Something does not work as intended / expected.

Comments

@pwntester
Copy link
Contributor

pwntester commented Sep 16, 2020

Hi,

I have a custom syntax that embeds markdown blocks, so my syntax file looks something like:

syntax include @markdown syntax/markdown.vim
...
syntax region comment matchgroup=CommentDelimiters start=/^---$/ keepend end=/^---$/  contains=@markdown

However, these blocks are highlighted using the built-in markdown syntax rather than MKDX one, since MKDX has its syntax defined in syntax/markdown/mkdx.vim. Moving this file to syntax/markdown.vim fixes my problem.

Is there any reason why the syntax file is defined in syntax/markdown/mkdx.vim rather than syntax/markdown.vim. If not, can we move this file?

Thanks,
A

@SidOfc
Copy link
Owner

SidOfc commented Sep 17, 2020

I'm not sure if this would cause any issues either actually, I'm not sure what my exact reasoning was when I first introduced the syntax file, perhaps just convention.

I'll check this out soon (also another issue that needs some attention so already had plans), If both vim and neovim function normally after the rename it shouldn't be a problem.

Cheers for the feedback 👍

@SidOfc SidOfc self-assigned this Sep 17, 2020
@SidOfc SidOfc added the bug:report Something does not work as intended / expected. label Sep 17, 2020
@pwntester
Copy link
Contributor Author

Thanks for considering it. Just to make it more clear, I could change the path of the include on my plugin, but I expect it to work with any markdown plugins. For example plasticboy one places the syntax file in the expected location.

Thanks!

@SidOfc
Copy link
Owner

SidOfc commented Sep 17, 2020

@pwntester you can test it out by updating mkdx, I checked vim and neovim and everything seemed fine. The syntax file should now be in the proper location.

Let me know if it works!

@pwntester
Copy link
Contributor Author

worked thanks!

@pwntester
Copy link
Contributor Author

Oops, seems there is one more change needed in autoload/mkdx.vim line 266:

let s:util.syn_loadpath  = join([s:util.mkdx_loadpath, 'after/syntax/markdown/mkdx.vim'], '/')

@pwntester pwntester reopened this Sep 17, 2020
SidOfc added a commit that referenced this issue Sep 18, 2020
@SidOfc
Copy link
Owner

SidOfc commented Sep 18, 2020

Good catch! Fixed it and checked for other occurrences of syntax/mkdx, there are no other cases.

@SidOfc SidOfc closed this as completed Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:report Something does not work as intended / expected.
Projects
None yet
Development

No branches or pull requests

2 participants