PKGBUILD highlighting messed up by ) in strings
A )
in strings, specially common in optdepends
, completely messes up the syntax highlighting following that line. And, actually, strings in general are not highlighted correctly.
In a new VM, I did the following: (To make absolutely certain no custom config is interfering)
pacman -Sy
pacman -S pacman-contrib asp
asp checkout neovim
vim neovim/repos/trung/community-x86_64/PKGBUILD
:set ft=PKGBUILD
As you can see, most of the strings are not highlighted as strings and after the optdepends, everything is completely messed up.
I have played around with it a bit and simply pasting the shSingleQuote definition (found in /usr/share/vim/vim82/syntax/sh.vim
) at the end of /usr/share/vim/vimfiles/syntax/PKGBUILD.vim
, fixes it for the most part:
Now, I have not the slightest idea why re-stating an already existing definition helps, or why it has to be after the optdepends
definition and does nothing if placed before, but those are my findings.
I originally intended on submitting a merge request with a fix, but I don't understand this behaviour and am out of my depth here. Sure, pasting the definition again at the end does work, but this doesn't strike me as a good solution.