comparison contrib/vim/syntax/nginx.vim @ 8808:5d88e2bf92b3

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".
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 22 Jan 2022 00:28:51 +0300
parents 76aea0ad78e5
children 1b7c7c3af6d9
comparison
equal deleted inserted replaced
8807:7752d8523066 8808:5d88e2bf92b3
2 " Language: nginx.conf 2 " Language: nginx.conf
3 3
4 if exists("b:current_syntax") 4 if exists("b:current_syntax")
5 finish 5 finish
6 end 6 end
7
8 let s:save_cpo = &cpo
9 set cpo&vim
7 10
8 " general syntax 11 " general syntax
9 12
10 if has("patch-7.4.1142") 13 if has("patch-7.4.1142")
11 " except control characters, ";", "{", and "}" 14 " except control characters, ";", "{", and "}"
2483 hi def link ngxDirectiveThirdPartyDeprecated Error 2486 hi def link ngxDirectiveThirdPartyDeprecated Error
2484 2487
2485 hi def link ngxListenOptions Keyword 2488 hi def link ngxListenOptions Keyword
2486 hi def link ngxListenOptionsDeprecated Error 2489 hi def link ngxListenOptionsDeprecated Error
2487 2490
2491 let &cpo = s:save_cpo
2492 unlet s:save_cpo
2493
2488 let b:current_syntax = "nginx" 2494 let b:current_syntax = "nginx"