Re: some vim syntax fixes for multi-lined commands

2012-11-14 Fir de Conversatie Charles E Campbell Jr

Alexey Radkov wrote:

Hi Charles.

Thank you!


You're welcome!



2012/11/14 Charles Campbell >

(snipped)


BTW, I prefer direct email contact for patches rather than via the
mailing list.


Ok, sure. But i did not know whom i should address with that.
At the top of the syntax files the Maintainers (usually) include their 
email address.  Mine is there, although one has to manually remove the 
NOSPAM embedded therein.


Regards,
Charles Campbell

--
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


Re: some vim syntax fixes for multi-lined commands

2012-11-13 Fir de Conversatie Alexey Radkov
Hi Charles.

Thank you!


2012/11/14 Charles Campbell 

> Alexey Radkov wrote:
>
>> Hi.
>>
>> I found another issue with vim sources syntax highlights.
>>
>> In the following code:
>>
>> fun! VimwikiLinkHandler(link)
>>   let link = a:link
>>   if link =~ "vlocal:" || link =~ "vfile:"
>> let link = link[1:]
>>   else
>> return 0
>>   endif
>>   " blah-blah
>> endif
>>
> Hello!
>
> I will accept the patches (except for the duplicate patching in the last
> one, which was rejected).
>

Yes, the 2nd patch included the first, therefore same part in 2nd patch was
rejected.


> Please try the version in http://www.drchip.org/**
> astronaut/vim/index.html#**SYNTAX_VIM
>

I tried. It works fine!


>
> (I don't remember why the onelines were there, I'm afraid)
>
> BTW, I prefer direct email contact for patches rather than via the mailing
> list.
>

Ok, sure. But i did not know whom i should address with that.


>
> Thank you for your contributions,
> C Campbell
>
> --
> 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
>

Cheers, Alexey.

-- 
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


Re: some vim syntax fixes for multi-lined commands

2012-11-13 Fir de Conversatie Charles Campbell

Alexey Radkov wrote:

Hi.

I found another issue with vim sources syntax highlights.

In the following code:

fun! VimwikiLinkHandler(link)
  let link = a:link
  if link =~ "vlocal:" || link =~ "vfile:"
let link = link[1:]
  else
return 0
  endif
  " blah-blah
endif

Hello!

I will accept the patches (except for the duplicate patching in the last 
one, which was rejected).


Please try the version in 
http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM


(I don't remember why the onelines were there, I'm afraid)

BTW, I prefer direct email contact for patches rather than via the 
mailing list.


Thank you for your contributions,
C Campbell

--
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


Re: some vim syntax fixes for multi-lined commands

2012-11-13 Fir de Conversatie Alexey Radkov
Hi.

I found another issue with vim sources syntax highlights.

In the following code:

fun! VimwikiLinkHandler(link)
  let link = a:link
  if link =~ "vlocal:" || link =~ "vfile:"
let link = link[1:]
  else
return 0
  endif
  " blah-blah
endif

line 'if link =~ "vlocal:" || link =~ "vfile:"' will be highlighted
incorrectly because link is mistakenly regarded as part of region vimHiLink
and highlighted as vimCommand (and the trail of the line is also spoiled).
'link[1:]' is also mistakenly regarded as part of region vimHiLink. The
problem is in definition of vimHiLink: it should check if
'\(def\%[ault]\s\+\)\=link\>\|\' is prceded by
'\(\=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}"skipwhite
nextgroup=vimString,vimSpecFile
 syn matchvimOper"||\|&&\|[-+.]"skipwhite
nextgroup=vimString,vimSpecFile
-syn regionvimOperParen oneline matchgroup=vimParenSepstart="("
end=")" contains=@vimOperGroup
-syn regionvimOperParenoneline matchgroup=vimSepstart="{"
end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
+syn regionvimOperParen matchgroup=vimParenSepstart="(" end=")"
contains=@vimOperGroup
+syn regionvimOperParenmatchgroup=vimSepstart="{" end="}"
contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
  syn matchvimOperError")"
 endif
@@ -328,7 +328,7 @@
 syn matchvimMapBangcontained"!"skipwhite
nextgroup=vimMapMod,vimMapLhs
 syn matchvimMapModcontained
"\c<\(buffer\|expr\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>"
contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
 syn matchvimMapRhscontained".*"
contains=vimNotation,vimCtrlCharskipnl nextgroup=vimMapRhsExtend
-syn matchvimMapRhsExtendcontained"^\s*\\.*$"
contains=vimContinue
+syn matchvimMapRhsExtendcontained"^\s*\\.*$"
contains=vimNotation,vimCtrlChar,vimContinueskipnl
nextgroup=vimMapRhsExtend
 syn case ignore
 syn keywordvimMapModKeycontainedbufferexprleader
localleaderplugscriptsidsilentunique
 syn case match
@@ -520,7 +520,7 @@
 syn keywordvimHiClearcontainedclearnextgroup=vimHiGroup

 " Highlight: link {{{2
-syn regionvimHiLinkcontained oneline matchgroup=vimCommand
start="\<\(def\%[ault]\s\+\)\=link\>\|\" end="$"
contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
+syn regionvimHiLinkcontained oneline matchgroup=vimCommand
start="\(\\|\\)"
end="$"contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
 syn cluster vimFuncBodyList add=vimHiLink

 " Control Characters {{{2


The patch is also included.

Cheers, Alexey.


2012/11/12 Alexey Radkov 

>
>
> -- Forwarded message --
> From: Alexey Radkov 
> Date: 2012/11/11
> Subject: some vim syntax fixes for multi-lined commands
> To: vim-...@vim.org
>
>
> (missed vim_dev@googlegroups recipient)
>
>
> Hi.
>
> Here are some fixes for errors in vim syntax highlight for multi-lined
> commands found when looking through my .vimrc and other vim sources. I used
> to keep lines in sources short (78 columns for vim) so i often used line
> breaks.
>
> The patch against current hg version (also attached):
>
>
> --- runtime/syntax/vim.vim2012-11-11 15:56:35.733116733 +0400
> +++ runtime/syntax/vim.vim.new2012-11-11 19:35:46.579257610 +0400
> @@ -152,8 +152,8 @@
>  syn clustervimOperGroup
> contains=vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
>  syn matchvimOper
> "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}"skipwhite
> nextgroup=vimString,vimSpecFile
>  syn matchvimOper"||\|&&\|[-+.]"skipwhite
> nextgroup=vimString,vimSpecFile
> -syn regionvimOperParen oneline matchgroup=vimParenSep
> start="(" end=")" contains=@vimOperGroup
> -syn regionvimOperParenoneline matchgroup=vimSepstart="{"
> end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
> +syn regionvimOperParen matchgroup=vimParenSepstart="("
> end=")" contains=@vimOperGroup
> +syn regionvimOperParenmatchgroup=vimSepstart="{" end="}"
> contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
>  if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
>   syn matchvimOperError")"
>  endif
> @@ -328,7 +328,7 @@
>  syn matchvimMapBangcontained"!"skipwhite
> nextgroup=vimMapMod,vimMapLhs
>  syn matchvimMapModcontained
> "\c<\(buffer\|expr\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>"
> contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
>  syn matchvimMapRhscontained".*"
> contains=vimNotation,vimCtrlCharskipnl nextgroup=vimMapRhsExtend
> -syn matchvimMapRhsExtendcontained"^\s*\\.*$"
> contains=vimContinue
> +syn matchvimMapRhsExtendcontained"^\s*\\.*$"
> contains=vimNotation,vimCtrlChar,vimCon