diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2022-01-22 00:28:51 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2022-01-22 00:28:51 +0300 |
commit | 7ba3063952f53b710d092f00881ccc2996c3b5fc (patch) | |
tree | 4fd4d5a150379a8b4bc3d11c3c58995f878ea2f7 | |
parent | 950390108cbb8431845635176c36466653b05487 (diff) | |
download | nginx-7ba3063952f53b710d092f00881ccc2996c3b5fc.tar.gz nginx-7ba3063952f53b710d092f00881ccc2996c3b5fc.zip |
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".
-rw-r--r-- | contrib/vim/syntax/nginx.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/vim/syntax/nginx.vim b/contrib/vim/syntax/nginx.vim index 1b52d4869..6828cd3e5 100644 --- a/contrib/vim/syntax/nginx.vim +++ b/contrib/vim/syntax/nginx.vim @@ -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 ngxDirectiveThirdPartyDeprecated Error hi def link ngxListenOptions Keyword hi def link ngxListenOptionsDeprecated Error +let &cpo = s:save_cpo +unlet s:save_cpo + let b:current_syntax = "nginx" |