vim-jp/vim-vimlparser

Bug with space in `syn region` regex

jez opened this issue · 0 comments

jez commented

Example

❯ cat foo.vim
syn region foo start=/^ \+\|\tx/ end=/x/

Expected behavior

No parse errors, as this is valid.

Actual behavior:

❯ vint foo.vim
foo.vim:1:29: E10: \\ should be followed by /, ? or & (see vim-jp/vim-vimlparser)

Workaround

Wrap the space before the \t in [ ].

❯ cat foo.vim
syn region foo start=/^[ ]\+\|\tx/ end=/x/

❯ vint foo.vim

❯

Version information

❯ vint --version
0.3.21

❯ vim --version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by linuxbrew@649894113f22

❯ cat /etc/lsb-release
DISTRIB_ID=Pop
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Pop!_OS 20.04 LTS"