FS#72647 - [pacman-contrib] 1.4.0-4: parentheses in optdepends break syntax highlighting in vim

Attached to Project: Community Packages
Opened by Pascal Ernster (hardfalcon) - Saturday, 06 November 2021, 07:48 GMT
Last edited by Daniel M. Capella (polyzen) - Friday, 18 February 2022, 05:31 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Johannes Löthberg (demize)
Daniel M. Capella (polyzen)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

In PKGBUILD scripts, optdepends() array members may contain parentheses in the text describing what features the respective optdepend is needed for. However, using parentheses currently breaks syntax highlighting since the closing parenthesis inside the descriptive text string is misinterpreted as closing parenthesis for the whole optdepends() array, which in turn results in the closing string delimiter (" or ') being ignored and thus essentially the whole syntax highlighting for the rest of the file going bonkers.

Here are two examples of PKGBUILDs affected by this issue:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=gnome-shell-extension-emoji-selector-git#n12

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=tilp#n16

Note that the issue only occurs if the optdepends() array is actually matched by the corresponding optdepends syntax highlighting rule, which requires the array to be at the beginning of the line and not being preceded by any whitespace/indention. For this reason, this bug doesn't occur with the following PKGBUILD:

https://github.com/archlinux/svntogit-packages/blob/packages/gvfs/trunk/PKGBUILD#L55

I've attached a patch which fixes the parentheses issue on my machine.
This task depends upon

Closed by  Daniel M. Capella (polyzen)
Friday, 18 February 2022, 05:31 GMT
Reason for closing:  None
Additional comments about closing:  Moved to https://gitlab.archlinux.org/pacman/pacm an-contrib/-/issues/6
Comment by Pascal Ernster (hardfalcon) - Saturday, 06 November 2021, 19:09 GMT
Turns out my patch is buggy incorrect and causes other syntax highlighting issues, so please don't merge the above patch. The issue remains to be solved.

Loading...