X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?p=spider.git;a=blobdiff_plain;f=perl%2Fconsole.pl;h=97b6220df84dbdec0663dc3263c368bc19faee32;hp=cd4a44927e5799c8bf13a2858bb5c11a97972f56;hb=2747e0fe4269e9a7e095c333598191eb9dca63fc;hpb=c8a6bc3e45bfbbaad776f4a6f22b3e501c8fc1c9 diff --git a/perl/console.pl b/perl/console.pl index cd4a4492..97b6220d 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -180,13 +180,18 @@ sub measure 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; @@ -208,8 +213,7 @@ sub show_screen 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; @@ -242,7 +246,8 @@ sub addtotop 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 {