dracula/vim

Dracula for Vim doesn't work in Vim 9.0. Fixed in this repo⬇️

ethanmchls opened this issue · 3 comments

Vim 9.0 Dracula

In Vim 9.0, Vim script no longer supports multi-line arrays and dictionaries the way Vim <=8.2 did. I patched the issue and got it to work with the latest version of Vim.

Repo

This would be better as a PR to the dracula/vim repo, but your repo isn't even really a fork (you appear to have copied all the code into a new history, modified it, and committed that, which makes it difficult to extract useful changes).

All that aside, I'm not sure what the problem is: I run the latest Vim and dracula/vim as it is today works. Vim 9.0 does not drop support for legacy Vimscript nor require vim9script to be used.

If you want to consider updating to vim9script, we can have that conversation, but that would probably mean dropping support for Neovim which I don't want to do right now.

It looks like you think there's some issue with line continuations:

# diff -r <proposed repo> <my copy of dracula>
File vim9-dracula/.git is a directory while file .vim/pack/colors/start/dracula/.git is a regular file
Only in .vim/pack/colors/start/dracula: .github
Only in .vim/pack/colors/start/dracula: .gitignore
diff -r vim9-dracula/INSTALL.md .vim/pack/colors/start/dracula/INSTALL.md
4a5,6
> These are the default instructions using Vim 8's `|packages|` feature. See sections below, if you use other plugin managers.
> 
10c12
< # vim 9+
---
> # vim 8.2+
11a14,15
> # vim 8.0
> mkdir -p ~/.vim/pack/themes/opt
22c26
< # vim 9+
---
> # vim 8.2+
23a28,29
> # vim 8.0
> cd ~/.vim/pack/themes/opt
31c37
< git clone https://github.com/ethanmchls/vim9-dracula.git dracula
---
> git clone https://github.com/dracula/vim.git dracula
38a45,47
> if v:version < 802
>     packadd! dracula
> endif
43,48d51
< If your background is gray rather than the proper dracula background, edit your `vimrc` and add the following:
< 
< ```
< let g:dracula_colorterm = 0
< ```
< 
61c64
< git submodule add git@github.com:ethanmchls/vim9-dracula.git bundle/dracula
---
> git submodule add git@github.com:dracula/vim.git bundle/dracula
69c72
< Plugin 'ethanmchls/vim9-dracula', { 'name': 'dracula' }
---
> Plugin 'dracula/vim', { 'name': 'dracula' }
79c82
< Plug 'ethanmchls/vim9-dracula', { 'as': 'dracula' }
---
> Plug 'dracula/vim', { 'as': 'dracula' }
93c96
<   repo = "ethanmchls/vim9-dracula"
---
>   repo = "dracula/vim"
diff -r vim9-dracula/README.md .vim/pack/colors/start/dracula/README.md
3c3
< > A dark theme for [Vim](http://www.vim.org/) that works with vim 9.0. The code found on the official [Dracula website](https://draculatheme.com) only works on vim 8.2 and below. Aside from bug fixes, this repo is identical to the [official repo](https://github.com/dracula/vim)
---
> > A dark theme for [Vim](http://www.vim.org/).
11c11
< Follow the instructions in [INSTALL.md](https://github.com/ethanmchls/vim9-dracula/blob/main/INSTALL.md).
---
> All instructions can be found at [draculatheme.com/vim](https://draculatheme.com/vim).
diff -r vim9-dracula/colors/dracula.vim .vim/pack/colors/start/dracula/colors/dracula.vim
111c111,118
< let s:attrs = {'bold': g:dracula_bold == 1 ? 'bold' : 0, 'italic': g:dracula_italic == 1 ? 'italic' : 0, 'strikethrough': g:dracula_strikethrough == 1 ? 'strikethrough' : 0, 'underline': g:dracula_underline == 1 ? 'underline' : 0, 'undercurl': g:dracula_undercurl == 1 ? 'undercurl' : 0, 'inverse': g:dracula_inverse == 1 ? 'inverse' : 0}
---
> let s:attrs = {
>       \ 'bold': g:dracula_bold == 1 ? 'bold' : 0,
>       \ 'italic': g:dracula_italic == 1 ? 'italic' : 0,
>       \ 'strikethrough': g:dracula_strikethrough == 1 ? 'strikethrough' : 0,
>       \ 'underline': g:dracula_underline == 1 ? 'underline' : 0,
>       \ 'undercurl': g:dracula_undercurl == 1 ? 'undercurl' : 0,
>       \ 'inverse': g:dracula_inverse == 1 ? 'inverse' : 0,
>       \}
133c140,146
<   let l:hl_string = ['highlight', a:scope, 'guifg=' . l:fg[0], 'ctermfg=' . l:fg[1], 'guibg=' . l:bg[0], 'ctermbg=' . l:bg[1], 'gui=' . l:attrs, 'cterm=' . l:attrs, 'guisp=' . l:special[0]]
---
>   let l:hl_string = [
>         \ 'highlight', a:scope,
>         \ 'guifg=' . l:fg[0], 'ctermfg=' . l:fg[1],
>         \ 'guibg=' . l:bg[0], 'ctermbg=' . l:bg[1],
>         \ 'gui=' . l:attrs, 'cterm=' . l:attrs,
>         \ 'guisp=' . l:special[0],
>         \]
734c747,749
< syn region xmlTagName matchgroup=xmlTag start=+</[^ /!?<>"']\@=+ matchgroup=xmlTag end=+>+
---
> syn region xmlTagName
> 	\ matchgroup=xmlTag start=+</[^ /!?<>"']\@=+
> 	\ matchgroup=xmlTag end=+>+
753c768,782
<   let g:fzf_colors = {'fg':      ['fg', 'Normal'], 'bg':      ['bg', 'Normal'], 'hl':      ['fg', 'Search'], 'fg+':     ['fg', 'Normal'], 'bg+':     ['bg', 'Normal'], 'hl+':     ['fg', 'DraculaOrange'], 'info':    ['fg', 'DraculaPurple'], 'border':  ['fg', 'Ignore'], 'prompt':  ['fg', 'DraculaGreen'], 'pointer': ['fg', 'Exception'], 'marker':  ['fg', 'Keyword'], 'spinner': ['fg', 'Label'], 'header':  ['fg', 'Comment'],}
---
>   let g:fzf_colors = {
>     \ 'fg':      ['fg', 'Normal'],
>     \ 'bg':      ['bg', 'Normal'],
>     \ 'hl':      ['fg', 'Search'],
>     \ 'fg+':     ['fg', 'Normal'],
>     \ 'bg+':     ['bg', 'Normal'],
>     \ 'hl+':     ['fg', 'DraculaOrange'],
>     \ 'info':    ['fg', 'DraculaPurple'],
>     \ 'border':  ['fg', 'Ignore'],
>     \ 'prompt':  ['fg', 'DraculaGreen'],
>     \ 'pointer': ['fg', 'Exception'],
>     \ 'marker':  ['fg', 'Keyword'],
>     \ 'spinner': ['fg', 'Label'],
>     \ 'header':  ['fg', 'Comment'],
>     \}

But again, Vim 9 did not remove support for line continuations in legacy script.

For now I'm closing this. If there's an actual issue here, please let us know and we can discuss.