Dasn wrote:

> The command:
> :so $VIMRUNTIME/ftplugin/man.vim
> :Man 3 gets
> 
> And the command on my box returns the following section:
> 
> ------------- %< ------------
> NAME
>      fgets, gets - get a line from a stream
> 
> SYNOPSIS
>      #include <stdio.h>
> 
>      char *
>      fgets(char *str, int size, FILE *stream);
> 
>      char *
>      gets(char *str);
> 
> DESCRIPTION
>      The fgets() function reads at most size-1 characters from the given
>      stream and stores them in the string str.        Reading stops when a 
> newline
> 
> ------------- %< ------------
> 
> Note, the 'DESCRIPTION' is not highlighted.
> 
> In the 'man.vim' syntax file, I found:
>       'end="^\u\+\s*$"he=e-12'
> 
> I wonder why the number 12 is used here?
> 
> The patch:
> 
> *** man.vim   Tue Dec 25 19:50:57 2007
> --- man.vim.orig      Tue Dec 25 19:50:25 2007
> ***************
> *** 36,42 ****
>   if getline(1) =~ '^[a-zA-Z_]\+([23])'
>     syntax include @cCode <sfile>:p:h/c.vim
>     syn match manCFuncDefinition  display "\<\h\w*\>\s*("me=e-1 contained
> !   syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$" keepend 
> contains=manSectionHeading,@cCode,manCFuncDefinition
>   endif
>   
>   
> --- 36,42 ----
>   if getline(1) =~ '^[a-zA-Z_]\+([23])'
>     syntax include @cCode <sfile>:p:h/c.vim
>     syn match manCFuncDefinition  display "\<\h\w*\>\s*("me=e-1 contained
> !   syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"he=e-12 
> keepend contains=manSectionHeading,@cCode,manCFuncDefinition
>   endif

I think it's better to change the "he" the "me".  So that not only the
highlighting ends, but also the match.

*** ../vim-7.1.175/runtime/syntax/man.vim       Sun Jun 13 19:51:12 2004
--- runtime/syntax/man.vim      Sun Dec 30 14:19:15 2007
***************
*** 36,42 ****
  if getline(1) =~ '^[a-zA-Z_]\+([23])'
    syntax include @cCode <sfile>:p:h/c.vim
    syn match manCFuncDefinition  display "\<\h\w*\>\s*("me=e-1 contained
!   syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"he=e-12 
keepend contains=manSectionHeading,@cCode,manCFuncDefinition
  endif
  
  
--- 36,42 ----
  if getline(1) =~ '^[a-zA-Z_]\+([23])'
    syntax include @cCode <sfile>:p:h/c.vim
    syn match manCFuncDefinition  display "\<\h\w*\>\s*("me=e-1 contained
!   syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"me=e-12 
keepend contains=manSectionHeading,@cCode,manCFuncDefinition
  endif
  
  


-- 
Linux is just like a wigwam: no Windows, no Gates and an Apache inside.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui