diff options
author | psyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet> | 2016-08-10 15:28:35 +0000 |
---|---|---|
committer | psyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet> | 2016-08-10 15:28:35 +0000 |
commit | e25b6dc768158af606964c56fbb5412af5ef334c (patch) | |
tree | c627da219f475e8f4f2d2087a9ad224c1142f02b /bin/psycamp | |
parent | c1363a95102dd70909a9a24c4decaaf4a18bfd53 (diff) | |
download | perlpsyc-e25b6dc768158af606964c56fbb5412af5ef334c.tar.gz perlpsyc-e25b6dc768158af606964c56fbb5412af5ef334c.zip |
psycamp: terminal width fixes
Diffstat (limited to 'bin/psycamp')
-rwxr-xr-x | bin/psycamp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/psycamp b/bin/psycamp index 770325b..f1d8c0a 100755 --- a/bin/psycamp +++ b/bin/psycamp | |||
@@ -1009,7 +1009,7 @@ sub printinfo { | |||
1009 | sub stringtail { | 1009 | sub stringtail { |
1010 | my $s = shift; | 1010 | my $s = shift; |
1011 | my $w = shift || $TWIDTH; | 1011 | my $w = shift || $TWIDTH; |
1012 | return length($s)>$w ? "...".substr($s,-$w+4) : $s; | 1012 | return length($s)>=$w ? "...".substr($s,-$w+4) : $s; |
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | sub ginxpect { | 1015 | sub ginxpect { |
@@ -1187,7 +1187,8 @@ sub ginparse { | |||
1187 | YELLOW. $CurrentSize .BLUE.'#'. $nlink .RESET: | 1187 | YELLOW. $CurrentSize .BLUE.'#'. $nlink .RESET: |
1188 | YELLOW. $CurrentSize .RESET; | 1188 | YELLOW. $CurrentSize .RESET; |
1189 | # consider color codes: | 1189 | # consider color codes: |
1190 | my $twidth = $nlink>1? $TWIDTH + 3*4 : $TWIDTH + 2*4; | 1190 | my $twidth = $TWIDTH + length(YELLOW) + length(RESET); |
1191 | $twidth += length(BLUE) if $nlink>1; | ||
1191 | $PrintCurrentFile = $codec? | 1192 | $PrintCurrentFile = $codec? |
1192 | "<$codec> $PrintCurrentFile ": $PrintCurrentFile .' '; | 1193 | "<$codec> $PrintCurrentFile ": $PrintCurrentFile .' '; |
1193 | $PrintCurrentFile .= &stringtail($nf, $twidth | 1194 | $PrintCurrentFile .= &stringtail($nf, $twidth |