Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Contrib: vim syntax, support block region

OOO
April 21, 2017 04:40AM
Actually nginx.vim supports on and off[1] before.
And some option also been highlighted because there are directives
with the same name, ex: ssl.
So if we complete remove this.
It will looks like the function is missing.

[1]:https://github.com/nginx/nginx/blob/73d27510c0d7022384a611269af22ff01634c6d0/contrib/vim/syntax/nginx.vim#L19-L20
[2]:https://github.com/nginx/nginx/blob/73d27510c0d7022384a611269af22ff01634c6d0/contrib/vim/syntax/nginx.vim#L416

2017-04-19 23:10 GMT+08:00 Maxim Dounin <mdounin@mdounin.ru>:
> Hello!
>
> On Wed, Apr 19, 2017 at 05:52:36PM +0800, OOO wrote:
>
>> Hi Dounin
>>
>> I have looked into your POC.
>> I use this approach in yajs.vim too.
>> The major problem of this approach is: It creates (sort of) redundant
>> syntax group.
>> For the listen directive:
>>
>> > syn keyword ngxDirectiveImportantListen listen
>> > \ nextgroup=@ngxListenParams skipwhite skipempty
>> > syn match ngxListenParam '\([^;{ \t\\]\|\\.\)\+'
>> > \ contained
>> > \ nextgroup=@ngxListenParams skipwhite skipempty
>> > syn region ngxListenString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+
>> > \ contained
>> > \ nextgroup=@ngxListenParams skipwhite skipempty
>> > syn match ngxListenComment '#.*$'
>> > \ contained
>> > \ nextgroup=@ngxListenParams skipwhite skipempty
>> > syn keyword ngxListenOptions contained
>> > \ default_server ssl http2 spdy proxy_protocol
>> > \ setfib fastopen backlog rcvbuf sndbuf accept_filter deferred bind
>> > \ ipv6only reuseport so_keepalive keepidle
>> > \ nextgroup=@ngxListenParams skipwhite skipempty
>> > syn cluster ngxListenParams
>> > \ contains=ngxListenParam,ngxListenString,ngxListenComment
>> > \ add=ngxListenOptions
>>
>> The ngxListenParam, ngxListenString, ngxListenComment and
>> ngxListenParams are the redundant groups.
>> For every directive we want to highlight params.
>> We will have to add four more syntax group like this one.
>
> Yes, this is exactly what I mean when I wrote that "this
> approach doesn't allow to extend things easily
> with highlighting of directive-specific parameters" in the
> previous messages. The most simple solution would be to avoid
> directive-specific parameters highlighting at all - nginx.vim
> never did this in the past, so probably this is a good enough
> solution.
>
> --
> Maxim Dounin
> http://nginx.org/
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel



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

[PATCH 1 of 4] Contrib: vim syntax, allow multiline config by skipempty

othree 586 March 03, 2017 05:58AM

[PATCH 3 of 4] Contrib: vim syntax, highlight HTTP status code

othree 273 March 03, 2017 05:58AM

[PATCH 2 of 4] Contrib: vim syntax, highlight rewrite flag

othree 249 March 03, 2017 05:58AM

[PATCH 4 of 4] Contrib: vim syntax, remove unecessary ngxBlock

othree 225 March 03, 2017 05:58AM

Re: [PATCH 4 of 4] Contrib: vim syntax, remove unecessary ngxBlock

Maxim Dounin 226 March 03, 2017 09:06AM

Re: [PATCH 4 of 4] Contrib: vim syntax, remove unecessary ngxBlock

OOO 273 March 03, 2017 10:40AM

Re: [PATCH 4 of 4] Contrib: vim syntax, remove unecessary ngxBlock

Maxim Dounin 265 March 03, 2017 12:26PM

[PATCH] Contrib: vim syntax, support block region

othree 280 March 04, 2017 07:00AM

Re: [PATCH] Contrib: vim syntax, support block region

OOO 276 March 10, 2017 11:46AM

Re: [PATCH] Contrib: vim syntax, support block region

Maxim Dounin 254 March 10, 2017 11:54AM

Re: [PATCH] Contrib: vim syntax, support block region

OOO 232 March 10, 2017 11:58AM

Re: [PATCH] Contrib: vim syntax, support block region

OOO 212 April 19, 2017 05:54AM

Re: [PATCH] Contrib: vim syntax, support block region

Maxim Dounin 196 April 19, 2017 11:12AM

Re: [PATCH] Contrib: vim syntax, support block region

OOO 202 April 21, 2017 04:40AM

Re: [PATCH] Contrib: vim syntax, support block region

Maxim Dounin 242 April 21, 2017 09:48AM

Re: [PATCH 4 of 4] Contrib: vim syntax, remove unecessary ngxBlock

OOO 284 March 04, 2017 07:20AM



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

Online Users

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