Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#42031 - [pacman] PKGBUILD vim syntax broken due to end parens matching even within quotes

Attached to Project: Pacman
Opened by need to rename username but can't, guess I'll create a new one then (m4cz3) - Saturday, 20 September 2014, 03:18 GMT
Last edited by Allan McRae (Allan) - Wednesday, 19 November 2014, 07:00 GMT
Task Type Bug Report
Category Scripts & Tools
Status Closed
Assigned To No-one
Architecture All
Severity Very Low
Priority Normal
Reported Version git
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
This is about editing PKGBUILD files with the included PKGBUILD.vim syntax for vim editor.
/usr/share/vim/vimfiles/syntax/PKGBUILD.vim

The vim syntax(colors) are broken if there is any closing parens inside quotes that would match the outside(of quotes) open parens.

Steps to Reproduce:
1. vim /tmp/PKGBUILD
2. paste these:

optdepends=( "chromium-pepper-flash-dev)" )
provides=('chromium-dev' 'chromedriver')

3. notice the `provides` line is now magenta, not yellow like `optdepends`
This is because of the closing parenthesis (the `dev)` part) inside the double quotes(though works with single quotes too) matches the open parens outside of the quotes (the `optdepends=(` part) ; also noting the fact that the closing parens(at end of line) doesn't match (using shift+5 on the parens to get to the matching one)

in a non PKGBUILD file, this seems to work ok, although in both files cursor under any closing parens match the outer start parens, the shift+5 action shows that the inner closing parens(inside double quotes) doesn't in the non PKGBUILD file.

4. this actually fails even if open and close parens are proper inside the quotes:
optdepends=("chromium-pepper-flash-dev()")

and now shift+5 works well, but the syntax colors are still messed up
(deducing that shift+5 works irrespective of syntax so is to be ignored here)

5. removing the parens inside the quotes fixes syntax highlighting

tested with latest pacman-git (commit d9cf14ff1d69ac8834b84015c7971f55ce77645b )
   PKGBUILD (0.3 KiB)
This task depends upon

Closed by  Allan McRae (Allan)
Wednesday, 19 November 2014, 07:00 GMT
Reason for closing:  Not a bug
Comment by Allan McRae (Allan) - Wednesday, 19 November 2014, 07:00 GMT
The pkgname can not contain brackets. So the highlighting is demonstrating an error in the PKGBUILD

Loading...