Rory Sales wrote:

> My name is Rory Sales
> I use vim often when doing sysadmin work on our multiple RedHat/Fedora/CentOS 
> servers.
> 
> I would like to now and then offer a syntax improvement to vim, and would 
> appreciate someone with knowledge adding them for me on github or being given 
> the ability to submit a change request.
> 
> First syntax update request.
> 
> example file affected: /etc/haproxy/haproxy.cfg
> github file: https://github.com/vim/vim/blob/master/runtime/syntax/cfg.vim
> 
> replace line
> syn match  CfgComment "\/\/.*"
> with line
> syn match  CfgComment   "\(http[s]\?:\)\@<!\/\/.*"
> 
> If my regex is not well formed please proceed to change as required.
> 
> This fix allows for comments in the .cfg files but not when the // forms part 
> of a http / https line. This maintains the colour syntax highlighting on that 
> line instead of colour and then suddenly a false positive on a comment.
> A common example in the HAProxy cfg files is as follows.
> 
> redirect prefix https://www.example.com code 301 if { ssl_fc_sni 
> secure.example.com }

CC'ing the maintainer.

A simpler way would be to check for white space before the //.

I also notice:

        " Comments (Everything before '#' or '//' or ';')

s/before/after/

-- 
Q: Why does /dev/null accept only integers?
A: You can't sink a float.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui