[PATCH] Contrib: removed ngxBlock syntax group

OOO othree at gmail.com
Thu Mar 3 15:11:49 UTC 2016


# HG changeset patch
# User Kao, Wei-Ko(othree) <othree at gmail.com>
# Date 1457016287 -28800
#      Thu Mar 03 22:44:47 2016 +0800
# Node ID 078464d1da32d30b0edef6f441d750765c1a4110
# Parent  3b9fe734a76ca0863ec87596369690831e9f4086
Contrib: removed ngxBlock syntax group

ngxBlock syntax group is not design well. If any directive's parameter
have `{`, then the syntax highlight of that directive will incorrect.

diff -r 3b9fe734a76c -r 078464d1da32 contrib/vim/syntax/nginx.vim
--- a/contrib/vim/syntax/nginx.vim    Tue Mar 01 15:18:07 2016 +0300
+++ b/contrib/vim/syntax/nginx.vim    Thu Mar 03 22:44:47 2016 +0800
@@ -10,28 +10,26 @@
 setlocal iskeyword+=:

 syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
-syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained
 syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
-syn region ngxBlock start=+^+ end=+{+ skip=+\${+
contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
 syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+
contains=ngxVariableString
 syn match ngxComment ' *#.*$'

 syn keyword ngxBoolean on
 syn keyword ngxBoolean off

-syn keyword ngxDirectiveBlock http         contained
-syn keyword ngxDirectiveBlock mail         contained
-syn keyword ngxDirectiveBlock events       contained
-syn keyword ngxDirectiveBlock server       contained
-syn keyword ngxDirectiveBlock types        contained
-syn keyword ngxDirectiveBlock location     contained
-syn keyword ngxDirectiveBlock upstream     contained
-syn keyword ngxDirectiveBlock charset_map  contained
-syn keyword ngxDirectiveBlock limit_except contained
-syn keyword ngxDirectiveBlock if           contained
-syn keyword ngxDirectiveBlock geo          contained
-syn keyword ngxDirectiveBlock map          contained
-syn keyword ngxDirectiveBlock split_clients contained
+syn keyword ngxDirectiveBlock http
+syn keyword ngxDirectiveBlock mail
+syn keyword ngxDirectiveBlock events
+syn keyword ngxDirectiveBlock server
+syn keyword ngxDirectiveBlock types
+syn keyword ngxDirectiveBlock location
+syn keyword ngxDirectiveBlock upstream
+syn keyword ngxDirectiveBlock charset_map
+syn keyword ngxDirectiveBlock limit_except
+syn keyword ngxDirectiveBlock if
+syn keyword ngxDirectiveBlock geo
+syn keyword ngxDirectiveBlock map
+syn keyword ngxDirectiveBlock split_clients

 syn keyword ngxDirectiveImportant include
 syn keyword ngxDirectiveImportant root
@@ -819,9 +817,7 @@

 hi link ngxComment Comment
 hi link ngxVariable Identifier
-hi link ngxVariableBlock Identifier
 hi link ngxVariableString PreProc
-hi link ngxBlock Normal
 hi link ngxString String

 hi link ngxBoolean Boolean


-- 
OOO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20160303/403eea11/attachment.html>


More information about the nginx-devel mailing list