Welcome! Log In Create A New Profile

Advanced

[nginx] Contrib: vim syntax adjusted to save cpoptions (ticket #2276).

Maxim Dounin
January 21, 2022 04:32PM
details: https://hg.nginx.org/nginx/rev/5d88e2bf92b3
branches:
changeset: 7996:5d88e2bf92b3
user: Maxim Dounin <mdounin@mdounin.ru>
date: Sat Jan 22 00:28:51 2022 +0300
description:
Contrib: vim syntax adjusted to save cpoptions (ticket #2276).

Line continuation as used in the syntax file might be broken if "compatible"
is set or "C" is added to cpoptions. Fix is to set the "cpoptions" option
to vim default value at script start and restore it later, see
":help use-cpo-save".

diffstat:

contrib/vim/syntax/nginx.vim | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r 7752d8523066 -r 5d88e2bf92b3 contrib/vim/syntax/nginx.vim
--- a/contrib/vim/syntax/nginx.vim Wed Jan 19 17:37:34 2022 -0800
+++ b/contrib/vim/syntax/nginx.vim Sat Jan 22 00:28:51 2022 +0300
@@ -5,6 +5,9 @@ if exists("b:current_syntax")
finish
end

+let s:save_cpo = &cpo
+set cpo&vim
+
" general syntax

if has("patch-7.4.1142")
@@ -2485,4 +2488,7 @@ hi def link ngxDirectiveThirdPartyDeprec
hi def link ngxListenOptions Keyword
hi def link ngxListenOptionsDeprecated Error

+let &cpo = s:save_cpo
+unlet s:save_cpo
+
let b:current_syntax = "nginx"
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[nginx] Contrib: vim syntax adjusted to save cpoptions (ticket #2276).

Maxim Dounin 375 January 21, 2022 04:32PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 168
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready