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

Error on startup after install (BufReadPost Autocommands d2#syntax_post Undefined variable: b:included_syntaxes) #13

Open
gitaarik opened this issue Aug 20, 2024 · 1 comment

Comments

@gitaarik
Copy link

I just added the plugin in my Nvchad nvim config, and I'm getting this error when I open a .d2 file:

Error detected while processing BufReadPost Autocommands for "*.d2"..FileType Autocommands for "*"..Syntax Autocommands for "d2"..function d2#syntax_post:
line    1:
E121: Undefined variable: b:included_syntaxes
E116: Invalid arguments for function index
Press ENTER or type command to continue

After pressing enter, the syntax highlighting is actually working.

If I close nvim again, then first open a file with a different file type, for example a .md file, I don't get an error. And when I then open the .d2 file in a second buffer, I still don't get an error, but the syntax is not working. When I enter :e! I do get the error again, and then afterwards the syntax highlighting is also working again.

@gitaarik
Copy link
Author

After reading #11 I fixed the issue by adding ft = { "d2" } to my plugin config:

{
  "terrastruct/d2-vim",
  ft = { "d2" },
}

I think this should be able to configure into the plugin itself?

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

No branches or pull requests

1 participant