Gentoo Archives: gentoo-user

From: Jorge Almeida <jalmeida@××××××××××××.pt>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] vim broken colours
Date: Tue, 05 Sep 2006 19:18:30
Message-Id: Pine.LNX.4.64.0609051909120.12550@toutatis.math.ist.utl.pt
1 On Tue, 5 Sep 2006, Richard Fish wrote:
2
3 > Jorge,
4 >
5 > Could I convince you to file a bug report on bugs.gentoo.org about that?
6 >
7 Richard:
8
9 I tried, but the reproducibility issue is weird.
10 Take a look at this block of code:
11 sub reloadlist{
12 my $self=shift;
13 # my $logdir=$self->{'dir'};
14 opendir(D,$logdir) || do{
15 print "Couldn\'t open directory ${logdir}: $!";
16 return 1;
17 };
18 my @heavy=grep(!/^\./, readdir(D));
19 closedir D || do{
20 print "Couldn\'t close directory ${logdir}: $!";
21 return 1;
22 };
23 my %heavy=();
24 my %numbers=();
25 my @full=();
26 for (@heavy){
27 /^[^_]*_(.*)/;
28 if(exists($numbers{$1})){
29 $numbers{$1}++;
30 }else{
31 $numbers{$1}=1;
32 }
33 push @full, "$1:$numbers{$1}:$_";
34 $heavy{$1}{$numbers{$1}}=$_;
35 }
36 @full=sort @full;
37 $self->{'full'}=\@full;
38 $self->{'heavy'}=\%heavy;
39 return 1;
40 }
41 Sure enough, colours are wrong. But pressing 'o' with cursor on line 4
42 (in normal mode) produces a new line with proper indentation. The same
43 action in the block of code of my former email produced bad
44 indentation...
45 On the other hand, uncommenting line 3 brings right colours for lines
46 after 3 (but not for 2 and 3).
47 There is no doubt that the file is wrong, but it seems difficult to
48 point the problem with accuracy.
49 If the package maintainer were reading this, the solution is simple: use
50 the current version:
51 " Vim syntax file
52 " Language: Perl
53 " Maintainer: Nick Hibma <nick@×××××××××××××.org>
54 " Last Change: 2006 August 9
55 " Location: http://www.van-laarhoven.org/vim/syntax/perl.vim
56 "
57 Regards,
58
59 Jorge
60 --
61 gentoo-user@g.o mailing list