Opened 4 weeks ago

Last modified 4 weeks ago

#2276 new defect

VIM syntax file errors with vim 8

Reported by: susnux@… Owned by:
Priority: minor Milestone:
Component: other Version:
Keywords: vim, syntax Cc:
uname -a: Linux HOSTNAME 5.14.14-1-default #1 SMP Thu Oct 21 05:05:03 UTC 2021 (2b5383f) x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.21.3
built by gcc 11.2.1 20210816 [revision 056e324ce46a7924b5cf10f61010cf9dd2ca10e9] (SUSE Linux)
built with OpenSSL 1.1.1l 24 Aug 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/ --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/run/ --lock-path=/run/nginx.lock --http-client-body-temp-path=/var/lib/nginx/tmp/ --http-proxy-temp-path=/var/lib/nginx/proxy/ --http-fastcgi-temp-path=/var/lib/nginx/fastcgi/ --http-uwsgi-temp-path=/var/lib/nginx/uwsgi/ --http-scgi-temp-path=/var/lib/nginx/scgi/ --user=nginx --group=nginx --without-select_module --without-poll_module --with-threads --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-perl=/usr/bin/perl --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module --with-stream_realip_module --with-stream_ssl_preread_module --with-pcre --with-pcre-jit --with-cc-opt='-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -D_GNU_SOURCE' --with-ld-opt='-Wl,-z,relro,-z,now -pie' --with-compat


When upgrading vim to version 8 the syntax file does not work anymore:

line 16:
E10: \ should be followed by /, ? or &

I attached a file with the error log.

So the line continuation does not work, as vim is, no idea why, reading syntax files now in vi-compatible mode.
By looking inside other syntax files I noticed this is commonly handled by setting the nocompatible mode manually for that syntax file.

I attached also a patch fixing this issue.

Attachments (2)

error.log (2.1 KB ) - added by susnux@… 4 weeks ago.
VIM error log
fix-nginx-syntax.patch (516 bytes ) - added by susnux@… 4 weeks ago.
Patch fixing the syntax file

Download all attachments as: .zip

Change History (3)

by susnux@…, 4 weeks ago

Attachment: error.log added

VIM error log

by susnux@…, 4 weeks ago

Attachment: fix-nginx-syntax.patch added

Patch fixing the syntax file

comment:1 by Maxim Dounin, 4 weeks ago

Works fine here at least with the following vim's:

  • 8.0.670 on FreeBSD 12.2
  • 8.2.2029 as in macOS 11.6
  • 8.2.2434 as in Ubuntu 21.04

I can reproduce the logs provided with cpo manually set to vi-compatible mode or with C option added, but it works flawlessly out of the box.

It looks like in your particular setup cpo is garbled somewhere, might be in some other syntax file or in the configuration (compatible set?). Could you please check if it is indeed what happens?

It probably make sense to save cpo anyway, but I'm curios what actually causes the issue here.

Note: See TracTickets for help on using tickets.