Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] [PATCH] Contrib: vim-syntax, add listen option and SSL/Mail protocol keywords

Maxim Dounin
February 20, 2017 12:00PM
Hello!

On Tue, Feb 21, 2017 at 12:10:22AM +0800, othree wrote:

> # HG changeset patch
> # User othree <othree@gmail.com>
> # Date 1487606986 -28800
> # Tue Feb 21 00:09:46 2017 +0800
> # Node ID 86edcdd053d07055b4773d144ddf78edea60af79
> # Parent 87cf6ddb41c216876d13cffa5e637a61b159362c
> [PATCH] Contrib: vim-syntax, add listen option and SSL/Mail protocol keywords

The '[PATCH]' here is certainly not needed.
More minor nits: summary line too long, and doesn't end with dot.
Suggested variant:

Contrib: vim syntax, listen option and SSL/Mail protocol keywords.

>
> diff --git a/contrib/vim/syntax/nginx.vim b/contrib/vim/syntax/nginx.vim
> --- a/contrib/vim/syntax/nginx.vim
> +++ b/contrib/vim/syntax/nginx.vim
> @@ -32,25 +32,43 @@ syn keyword ngxDirectiveBlock if
> syn keyword ngxDirectiveBlock geo contained
> syn keyword ngxDirectiveBlock map contained
> syn keyword ngxDirectiveBlock split_clients contained
>
> syn keyword ngxDirectiveImportant include
> syn keyword ngxDirectiveImportant root
> syn keyword ngxDirectiveImportant server
> syn keyword ngxDirectiveImportant server_name
> -syn keyword ngxDirectiveImportant listen
> +syn keyword ngxDirectiveImportant listen contained
> +syn region ngxDirectiveImportantListen matchgroup=ngxDirectiveImportant start=/listen/ end=/;\zs/ contains=ngxListenOptions

Note that this breaks on the following valid listen directives:

listen "unix:/tmp/foo;bar";
listen 'unix:/tmp/foo;bar';
listen unix:/tmp/foo\;bar;

> syn keyword ngxDirectiveImportant internal
> syn keyword ngxDirectiveImportant proxy_pass
> syn keyword ngxDirectiveImportant memcached_pass
> syn keyword ngxDirectiveImportant fastcgi_pass
> syn keyword ngxDirectiveImportant scgi_pass
> syn keyword ngxDirectiveImportant uwsgi_pass
> syn keyword ngxDirectiveImportant try_files
>
> +syn keyword ngxListenOptions ssl contained
> +syn keyword ngxListenOptions http2 contained
> +syn keyword ngxListenOptions spdy contained
> +syn keyword ngxListenOptions proxy_protocol contained
> +syn keyword ngxListenOptions setfib contained
> +syn keyword ngxListenOptions fastopen contained
> +syn keyword ngxListenOptions backlog contained
> +syn keyword ngxListenOptions rcvbuf contained
> +syn keyword ngxListenOptions sndbuf contained
> +syn keyword ngxListenOptions accept_filter contained
> +syn keyword ngxListenOptions deferred contained
> +syn keyword ngxListenOptions bind contained
> +syn keyword ngxListenOptions ipv6only contained
> +syn keyword ngxListenOptions reuseport contained
> +syn keyword ngxListenOptions so_keepalive contained
> +syn keyword ngxListenOptions keepidle contained

The "default_server" parameter missing.

--
Maxim Dounin
http://nginx.org/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] [PATCH] Contrib: vim-syntax, add listen option and SSL/Mail protocol keywords

othree 357 February 20, 2017 11:12AM

Re: [PATCH] [PATCH] Contrib: vim-syntax, add listen option and SSL/Mail protocol keywords

Maxim Dounin 206 February 20, 2017 12:00PM



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

Online Users

Guests: 187
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