Closed bmizerany closed 1 year ago
I have this issue too, on NVIM v0.8.0-dev-1025-gfb39bba5a-dirty
.
I was not able to understand where the error comes from neither, all functions referencing d2_block_string_syntaxes
appears to check for its existence before hand. And this variable is defined fairly early too.
One interesting thing I found is that if you open n*vim first, then open a d2 file you won't have an issue.
The issue only shows when you open the file directly (ie. vim test.d2
).
One interesting thing I found is that if you open n*vim first, then open a d2 file you won't have an issue.
Thank you for your explanation! Now I've reproduced it, too.
I'm not sure why but I'm not able to reproduce this issue. I'm on NVIM v0.9.0-dev-280+gfae754073
and don't have that variable predefined in my init.vim.
Do you guys have a syntax on
or filetype plugin on
somewhere in your init.vim?
yes
You don't need either in neovim, try removing and see if it works without error.
I checked on minimal configuration. It's true. syntax on
broke this plugin.
I think it's very strange...
=============================================================================
Quick start :syn-qstart
*:syn-enable* *:syntax-enable* *:syn-on* *:syntax-on*
Syntax highlighting is enabled by default. If you need to enable it again after it was disabled (see below), use: >
:syntax enable
Alternatively: >
:syntax on
And I have to enable syntax on
to enable syntax folding
If you add a filetype plugin on
before syntax on
things should work I think.
Though you shouldn't need syntax on
for folding.
Just a friendly ping to see if you guys were able to fix by putting filetype plugin on
before syntax on
.
FWIW, adding filetype plugin on
before syntax on
did resolve this issue for me.
If this isn't "fixable", might be good to add a docs note about this in the README. I've never needed to set that up for other syntax plugins.
(side note: I'm using pathogen, if it matters)
hmm yeah, i'll leave this open after all then
I've already fixed this in MR. Why you don't want to merge it?
yeah i think if people are running into this with non-outlier vim configs, we should merge that. @nhooyr your call though
Ok I'll concede, there's supposed to be an order but perhaps in practice it's not strictly followed. I approved #5
Confirmed #5 resolves this for me (with vanilla vim 9), even if i remove filetype plugin on
again.
Using
I installed d2-vim using vim's built-in plugins like:
Current HEAD is
d1cb1e7e22bc0fb4d4034a1b93c2a13cc471acc6
When I opened
vim x.d2
, I got:I tried pre-defining in my
~/.vimrc
like:but that didn't help.
I'm a little stumped because my vim-script fu is weak. Any pointers would be appreciated.