simpler fix: do the \n printing always for glitching terminals
This commit is contained in:
parent
228149426e
commit
a3ca1adf1f
@ -1,5 +1,5 @@
|
||||
# ex:ts=8 sw=4:
|
||||
# $OpenBSD: Reporter.pm,v 1.6 2010/03/04 20:48:12 espie Exp $
|
||||
# $OpenBSD: Reporter.pm,v 1.7 2010/03/05 07:50:15 espie Exp $
|
||||
#
|
||||
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
@ -212,8 +212,8 @@ sub cut_lines
|
||||
sub clamped
|
||||
{
|
||||
my ($self, $line) = @_;
|
||||
if (length $line >= $self->{width}) {
|
||||
return substr($line, 0, $self->{width});
|
||||
if (!$self->{glitch} && length $line == $self->{width}) {
|
||||
return $line;
|
||||
} else {
|
||||
return $line."\n";
|
||||
}
|
||||
@ -225,7 +225,6 @@ sub lines
|
||||
|
||||
my $n = 2;
|
||||
my $r = '';
|
||||
my $glitching = 0;
|
||||
|
||||
while (my $newline = shift @new) {
|
||||
my $oldline = shift @{$self->{oldlines}};
|
||||
@ -234,10 +233,6 @@ sub lines
|
||||
if (defined $oldline && $oldline eq $newline) {
|
||||
if ($self->{down}) {
|
||||
$r .= $self->{down};
|
||||
if ($glitching && $self->{glitch}) {
|
||||
$r .= $self->{down};
|
||||
}
|
||||
$glitching = 0;
|
||||
next;
|
||||
}
|
||||
}
|
||||
@ -246,9 +241,6 @@ sub lines
|
||||
$newline .= " "x ((length $oldline) - (length $newline));
|
||||
}
|
||||
$r .= $self->clamped($newline);
|
||||
if (length($newline) == $self->{width}) {
|
||||
$glitching = 1;
|
||||
}
|
||||
}
|
||||
# extra lines must disappear
|
||||
while (my $line = shift(@{$self->{oldlines}})) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user