my $t = ztime($_[2]);
my $loc = '';
- my $clth = $self->{consort} eq 'local' ? 29 : 30;
+ my $clth = 30;
+ --$clth if $self->{consort} eq 'local';
+
my $comment = substr (($_[3] || ''), 0, $clth);
$comment .= ' ' x ($clth - (length($comment)));
- if ($self->{user}->wantgrid) {
- my $ref = DXUser::get_current($_[1]);
- if ($ref && $ref->qra) {
- $loc = ' ' . substr($ref->qra, 0, 4);
- $comment = substr $comment, 0, ($clth - (length($comment)+length($loc)));
- $comment .= $loc;
- $loc = '';
- }
- }
if ($self->{user}->wantgrid) {
my $ref = DXUser::get_current($_[4]);
}
}
- if ($self->{user}->wantdxitu) {
+ if ($self->{user}->wantgrid) {
+ my $ref = DXUser::get_current($_[1]);
+ if ($ref && $ref->qra) {
+ $loc = ' ' . substr($ref->qra, 0, 4);
+ $comment = substr $comment, 0, ($clth - (length($comment)+length($loc)));
+ $comment .= $loc;
+ $loc = '';
+ }
+ } elsif ($self->{user}->wantdxitu) {
$loc = ' ' . sprintf("%2d", $_[10]) if defined $_[10];
- $comment = substr($comment, 0, $self->{consort} eq 'local' ? 26 : 27) . ' ' . sprintf("%2d", $_[8]) if defined $_[8];
+ $comment = substr($comment, 0, $clth-3) . ' ' . sprintf("%2d", $_[8]) if defined $_[8];
} elsif ($self->{user}->wantdxcq) {
$loc = ' ' . sprintf("%2d", $_[11]) if defined $_[11];
- $comment = substr($comment, 0, $self->{consort} eq 'local' ? 26 : 27) . ' ' . sprintf("%2d", $_[9]) if defined $_[9];
+ $comment = substr($comment, 0, $clth-3) . ' ' . sprintf("%2d", $_[9]) if defined $_[9];
} elsif ($self->{user}->wantusstate) {
$loc = ' ' . $_[13] if $_[13];
- $comment = substr($comment, 0, $self->{consort} eq 'local' ? 26 : 27) . ' ' . $_[12] if $_[12];
+ $comment = substr($comment, 0, $clth-3) . ' ' . $_[12] if $_[12];
}
return sprintf "DX de %-7.7s%11.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment;
sub show_screen
{
if ($spos == @shistory - 1) {
-
# if we really are scrolling thru at the end of the history
my $line = $shistory[$spos];
- $top->addstr("\n") if $spos > 0;
+ my $y = $spos;
+ if ($spos >= $pagel) {
+ $top->scrl(1);
+ $y = $pagel-1;
+# $top->addstr("\r");
+ }
+ $top->move($y, 0);
+ $top->refresh;
setattr($line);
$top->addstr($line);
-# $top->addstr("\n");
$top->attrset(COLOR_PAIR(0)) if $has_colors;
$spos = @shistory;
for ($i = 0; $i < $pagel && $p < @shistory; $p++) {
my $line = $shistory[$p];
my $lines = measure($line);
- last if $i + $lines > $pagel;
- $top->addstr("\n") if $i;
+ $top->move($i, 0);
setattr($line);
$top->addstr($line);
$top->attrset(COLOR_PAIR(0)) if $has_colors;
if ($inbuf =~ s/\x07+$//) {
beep();
}
- if (length $inbuf >= $cols) {
+ $inbuf =~ s/\s+$//s;
+ if (length $inbuf > $cols) {
$Text::Wrap::Columns = $cols;
push @shistory, wrap('',"\t", $inbuf);
} else {