Syntax highlighting problem in vim

Hi!

vim does not get this correct:

header = [ /^Date: /,
/^From /,
/^Reply-To: /,
/^Sender: /,
/^From: /,
/^To: /,
/^Cc: /,
/^Subject: /
]

Josef ‘Jupp’ Schugt http://jupp.tux.nu jupp(AT)gmx(DOT)de

···


“Mankind must put an end to war before war puts an end to mankind.”
– John F. Kennedy

Negative. It is correct for me. How is it displayed at you?

···

On 0331, Josef ‘Jupp’ Schugt wrote:

vim does not get this correct:

header = [ /^Date: /,
/^From /,
/^Reply-To: /,
/^Sender: /,
/^From: /,
/^To: /,
/^Cc: /,
/^Subject: /
]

Josef ‘Jupp’ Schugt http://jupp.tux.nu jupp(AT)gmx(DOT)de

“Mankind must put an end to war before war puts an end to mankind.”
– John F. Kennedy


±[ Kontra, Gergelykgergely@mcl.hu PhD student Room IB113 ]---------+

http://www.mcl.hu/~kgergely “Olyan langesz vagyok, hogy |
Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval kellene jarnom” |
±–Magyar php mirror es magyar php dokumentacio: http://hu.php.net---+

Thanks. I’ll fix it.

Regards,
Doug

···

On Mon, Mar 31, 2003 at 10:32:19PM +0900, Josef ‘Jupp’ Schugt wrote:

Hi!

vim does not get this correct:

header = [ /^Date: /,
/^From /,
/^Reply-To: /,
/^Sender: /,
/^From: /,
/^To: /,
/^Cc: /,
/^Subject: /
]

I confirm that it does not work properly. However:

header = [ %r{^Date: },
%r{^From },
%r{^Reply-To: },
%r{^Sender: },
%r{^From: },
%r{^To: },
%r{^Cc: },
%r{^Subject: }
]

works perfectly. I’m using the version dated 12-APR-2002 by Hugh
Sasse. I also have some custom modifications (improper highlighting
when I have ?:, ?<, etc. character markers).

-austin
– Austin Ziegler, austin@halostatue.ca on 2003.03.31 at 09:41:19

···

On 0331, Josef ‘Jupp’ Schugt wrote:

vim does not get this correct:

header = [ /^Date: /,
/^From /,
/^Reply-To: /,
/^Sender: /,
/^From: /,
/^To: /,
/^Cc: /,
/^Subject: /
]

On Mon, 31 Mar 2003 23:25:25 +0900, KONTRA Gergely wrote:

Negative. It is correct for me. How is it displayed at you?

Wrong colors and incorrect indentation when I make it reindent.

···

On Mon, Mar 31, 2003 at 11:25:25PM +0900, KONTRA Gergely wrote:

Negative. It is correct for me. How is it displayed at you?

                                   =========================

:wink:

On 0331, Josef ‘Jupp’ Schugt wrote:

vim does not get this correct:

header = [ /^Date: /,
/^From /,
/^Reply-To: /,
/^Sender: /,
/^From: /,
/^To: /,
/^Cc: /,
/^Subject: /
]


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

I once witnessed a long-winded, month-long flamewar over the use of
mice vs. trackballs… It was very silly.
– Matt Welsh

Thanks for underlining the point. I’d hate to have missed it! :wink:

I’ve attached the latest, bleeding edge indent/ruby.vim. Anyone who
cares deeply about Ruby, Vim and indenting might want to play with
it. Some things may be broken, but there are some good things
implemented, and just maybe someone can improve on it.

Gavin

PS. DON’T delete the real indent/ruby.vim.

ruby.vim (4.69 KB)

···

On Tuesday, April 1, 2003, 1:58:45 AM, Mauricio wrote:

On Mon, Mar 31, 2003 at 11:25:25PM +0900, KONTRA Gergely wrote:

Negative. It is correct for me. How is it displayed at you?

Wrong colors and incorrect indentation when I make it reindent.
=========================
:wink:

[…]

works perfectly. I’m using the version dated 12-APR-2002 by Hugh
Sasse. I also have some custom modifications (improper highlighting
when I have ?:, ?<, etc. character markers).

As is probably apparent from his posting, Gavin Sinclair is looking
after syntax highlighting now. My modifications were basically to
add folding where there was none before, but I may well have missed
subtleties in doing so. I’d encourage you to use a more recent
syntax file, as I now am. I certainly didn’t create the bulk of
that file, so deserve only so much credit!

-austin
– Austin Ziegler, austin@halostatue.ca on 2003.03.31 at 09:41:19

    Hugh
···

On Mon, 31 Mar 2003, Austin Ziegler wrote:

Negative. It is correct for me. How is it displayed at you?

Wrong colors and incorrect indentation when I make it reindent.
=========================
:wink:

Thanks for underlining the point. I’d hate to have missed it! :wink:

I underlined it cause I did miss it. Just as I was about to reply “works
for me” I thought, hey, wait, that’s cause I simply pasted the code w/
the correct indentation :slight_smile:

I’ve attached the latest, bleeding edge indent/ruby.vim. Anyone who
cares deeply about Ruby, Vim and indenting might want to play with
it. Some things may be broken, but there are some good things
implemented, and just maybe someone can improve on it.

What’s the best reference to master the magic involved w/ *.vim (in order
to be able to modify it oneself)? Vim’s manual or something more
specific?

···

On Tue, Apr 01, 2003 at 10:51:57PM +0900, Gavin Sinclair wrote:

On Tuesday, April 1, 2003, 1:58:45 AM, Mauricio wrote:

On Mon, Mar 31, 2003 at 11:25:25PM +0900, KONTRA Gergely wrote:


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

How many chunks could checkchunk check if checkchunk could check chunks?
– Alan Cox

When does ruby.vim get released? Is it with vim itself? What’s the
correct path for patches? Is there a ruby script that can be used to
test it (so patches don’t break anything)?

Paul

···

On Tue, Apr 01, 2003 at 10:51:57PM +0900, Gavin Sinclair wrote:

I’ve attached the latest, bleeding edge indent/ruby.vim. Anyone who
cares deeply about Ruby, Vim and indenting might want to play with
it. Some things may be broken, but there are some good things
implemented, and just maybe someone can improve on it.

Hmmm… I hope not. Doug Kearns is the maintainer of that beast. I
respect anyone who can look at it without getting a headache!

Gavin

···

On Wednesday, April 2, 2003, 12:21:45 AM, Hugh wrote:

On Mon, 31 Mar 2003, Austin Ziegler wrote:

    [...]

works perfectly. I’m using the version dated 12-APR-2002 by Hugh
Sasse. I also have some custom modifications (improper highlighting
when I have ?:, ?<, etc. character markers).

As is probably apparent from his posting, Gavin Sinclair is looking
after syntax highlighting now.

What’s the best reference to master the magic involved w/ *.vim (in order
to be able to modify it oneself)? Vim’s manual or something more
specific?

Vim’s manual was all I could find when looking online, plus reading
of other syntax files.
:he usr_44.txt
is good. lots to learn there :slight_smile: The self-referential syntax
highlighting for syntax files is a useful help as well. (Does
Douglas Hofstadter use vim? :-))

    Hugh
···

On Tue, 1 Apr 2003, Mauricio [iso-8859-1] Fernández wrote:

You can put the file in ~/.vim/indent/ (for unix, im not sure about windows). If it doesn’t work properly, remove it and vim will go back to using the file in /usr/share/vim/vim##/indent/

···

On Wed, 2 Apr 2003 00:31:27 +0900 Paul Brannan pbrannan@atdesk.com wrote:

When does ruby.vim get released? Is it with vim itself? What’s the
correct path for patches? Is there a ruby script that can be used to
test it (so patches don’t break anything)?

Paul


To call me “awesome” is an understatement.

It's extremely ad hoc. I have very little ability with Vim scripting,
so the file is a bit tangled at the moment. The file is released
independently of Vim itself, with one release since Vim 6.1, which
you can find by reading VimRubySupport on the Wiki.

I'd like to create a sourceforge project for it, but really, this is
not my strength at all.

Gavin

···

On Wednesday, April 2, 2003, 1:31:27 AM, Paul wrote:

On Tue, Apr 01, 2003 at 10:51:57PM +0900, Gavin Sinclair wrote:

I've attached the latest, bleeding edge indent/ruby.vim. Anyone who
cares deeply about Ruby, Vim and indenting *might* want to play with
it. Some things may be broken, but there are some good things
implemented, and just maybe someone can improve on it.

When does ruby.vim get released? Is it with vim itself? What's the
correct path for patches? Is there a ruby script that can be used to
test it (so patches don't break anything)?

    [...]

works perfectly. I’m using the version dated 12-APR-2002 by Hugh
Sasse. I also have some custom modifications (improper highlighting
when I have ?:, ?<, etc. character markers).

As is probably apparent from his posting, Gavin Sinclair is looking
after syntax highlighting now.

Hmmm… I hope not. Doug Kearns is the maintainer of that beast. I
respect anyone who can look at it without getting a headache!

Sorry for this. I should have checked on RubyGarden

before posting, like I nearly did. That old Fidonet sig of
“Open mouth, insert foot, echo internationally”.
comes to mind… Apologies for not giving credit where it is due,
and for tainting the archives with this misinformation.

Gavin

    Hugh
···

On Wed, 2 Apr 2003, Gavin Sinclair wrote:

On Wednesday, April 2, 2003, 12:21:45 AM, Hugh wrote:

On Mon, 31 Mar 2003, Austin Ziegler wrote:

I think Paul was looking for a way to automatically prove that new
versions of ruby.vim work as expected, especially because it is hard
to do so from simply looking at the code. Think of it as an automated
unit test for ruby.vim.

Maybe we could automatically open one or more Ruby test files in vim,
let vim indent it, and then export it to HTML. By comparing the
generated HTML file to a HTML file containing the expected results,
we could test both syntax highlighting and indentation.

Using a preliminary version of such a test I found that the new
version of ruby.vim doesn’t indent this code correctly, while the
previous version did:

class C
def m
/re/
end
end

I think that such a tool could be very useful for the maintainers of
ruby.vim (and those of other vim syntax files btw). I’ll publish my
code somewhere on RubyGarden after polishing it a little bit.

Regards,
Pit

···

On 2 Apr 2003 at 5:05, nico wrote:

On Wed, 2 Apr 2003 00:31:27 +0900 > Paul Brannan pbrannan@atdesk.com wrote:

When does ruby.vim get released? Is it with vim itself? What’s the
correct path for patches? Is there a ruby script that can be used to
test it (so patches don’t break anything)?

Paul

You can put the file in ~/.vim/indent/ (for unix, im not sure about windows). If it doesn’t work properly, remove it and vim will go back to using the file in /usr/share/vim/vim##/indent/

You might think about posting it to vim.sf.net also. This sounds
extremely useful (speaking as a syntax file writer myself) for any vim
syntax or indent file.

···

Pit Capitain pit@capitain.de wrote:

I think that such a tool could be very useful for the maintainers of
ruby.vim (and those of other vim syntax files btw). I’ll publish my
code somewhere on RubyGarden after polishing it a little bit.

Hans Fugal | De gustibus non disputandum est.
http://hans.fugal.net/ | Debian, vim, mutt, ruby, text, gpg
http://gdmxml.fugal.net/ | WindowMaker, gaim, UTF-8, RISC, JS Bach


GnuPG Fingerprint: 6940 87C5 6610 567F 1E95 CB5E FC98 E8CD E0AA D460