Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-10 Thread Charles E Campbell Jr

Ian Tegebo wrote:


On 4/9/07, Nikolai Weibull <[EMAIL PROTECTED]> wrote:


The manSubHeading is defined as

syn match  manSubHeading  "^\s\{3\}[a-z][a-z ]*[a-z]$"

This will, however, match more lines than I think is intended.  It
will, for example, match the line

\t  returns are what are recorded and compared with the data git keeps

where "\t" is a horizontal tabulation.  I'm guessing that the actual
regex should be

  ^ \{3\}[a-z][a-z ]*[a-z]$


I hope nobody minds if I take this opportunity to ask a question about
vim's pattern matching.

After reading |pattern| I wonder if the following is more efficient:

syn match manSubHeading '^ \{3\}\l\l\?\l$'


(snip)

The pattern you've provided isn't matching the same thing.
The current one: start the line with exactly three spaces or tabs,
followed by a lower case character, followed by any number of
lower case characters or spaces, up to a lower case character
at the end-of-line.

 example:   aaa aa

Nikolai W's modifies that to "start the line with exactly three spaces"; the
rest is the same.

 example: aaa aa aaa

Yours: start the line with exactly three spaces, followed by two or three
lower case characters, which then terminates the line.

 example: aa


Do people find this to make a different for moderate file sizes, e.g.
the man page for 'less' being ~2000 lines?



Depends on the line lengths.  Your pattern would terminate quite
quickly on each line, as only 5 or 6 characters may be at the beginning
of matching lines; anything more is a mismatch.  The original and NW's
both examine the entire line; so if every line had 1GB of characters, these
two patterns would take considerably longer than yours.

Regards,
Chip Campbell




Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-10 Thread Charles E Campbell Jr

Nikolai Weibull wrote:


On 4/9/07, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:


In this case, by looking at syntax/man.vim, its:  Gautam H. Mudunuri
.



Actually, this was actually the wrong maintainer.  Gautam was the
previous maintainer of this file.  Nam SungHyun <[EMAIL PROTECTED]>
maintains it now.


Whoops -- yes, you're quite right.  Sorry 'bout that...

Chip Campbell



Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-10 Thread Nikolai Weibull

On 4/10/07, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:

Nikolai Weibull wrote:

> On 4/9/07, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:
>
>> In this case, by looking at syntax/man.vim, its:  Gautam H. Mudunuri
>> .
>
>
> Actually, this was actually the wrong maintainer.  Gautam was the
> previous maintainer of this file.  Nam SungHyun <[EMAIL PROTECTED]>
> maintains it now.

Whoops -- yes, you're quite right.  Sorry 'bout that...


What's worse is that that address is no longer valid.  I've tried
another address attached to one Nam SungHyun.  We'll see if he
responds.

 nikolai