ADDED: new configfile parameter PrintLines (default: YES), which

controls wether listings are separated by horizontal lines.
This commit is contained in:
TLINDEN
2012-02-10 20:32:00 +01:00
parent 8779f24249
commit 7b47e6bb10
29 changed files with 7513 additions and 14 deletions

View File

@@ -123,7 +123,7 @@ $CONF = File::Spec->catfile($ENV{HOME}, ".noterc");
$USER = getlogin || getpwuid($<);
chomp $USER;
$TOPIC = 1;
$version = "1.3.1";
$version = "1.3.3";
$CurDepth = 1; # the current depth inside the topic "directory" structure...
$maxlen = "auto";
$timelen = 22;
@@ -1271,9 +1271,11 @@ sub output {
$SSS = "-" x ($maxlen + 30);
$nlen = length("$num");
$LINE = "$BORDERC $SSS $_BORDERC\n";
$L = $BORDERC . "[" . $_BORDERC;
$LONGSPC = " " x (25 - $nlen);
$R = $BORDERC . "]" . $_BORDERC;
if ($conf{printlines}) {
$L = $BORDERC . "[" . $_BORDERC;
$R = $BORDERC . "]" . $_BORDERC;
}
$PathLen = length($PATH); # will be ZERO, if not in TOPIC mode!
$VersionLen = length($version) + 7;
@@ -1284,13 +1286,13 @@ sub output {
$SP = " " x ($maxlen - 2 - $PathLen - $VersionLen);
if (!$Raw) {
# no title in raw-mode!
print C $LINE;
print C $LINE if ($conf{printlines});
print C "$L $NUMC#$_NUMC ";
if ($ListType eq "LONG") {
print C " $TIMEC" . "creation date$_TIMEC ";
}
else {
print $LONGSPC;
print $LONGSPC if ($conf{printlines});
}
if ($TOPIC) {
print C $TOPICC . "$PATH $_TOPICC$SP" . " note $version $R\n";
@@ -1298,7 +1300,7 @@ sub output {
else {
print C $NOTEC . "note$_NOTEC$SP" . " note $version $R\n";
}
print C $LINE;
print C $LINE if ($conf{printlines});
}
$SetTitle = 1;
}
@@ -1328,7 +1330,7 @@ sub output {
else {
$title = substr($note,0,($txtlen - 2 - $nlen));
if (!$Raw) {
$title = $BORDERC . $NOTEC . $title . "... $_NOTEC$_BORDERC";
$title = $BORDERC . $NOTEC . $title . " $_NOTEC$_BORDERC";
}
}
if ($Raw) {
@@ -1346,18 +1348,18 @@ sub output {
print C "$L$TIMEC" . $time . " $_TIMEC$R";
}
print C "$L $NOTEC" . $title . "$_NOTEC $R\n";
print C $LINE;
print C $LINE if ($conf{printlines});
}
}
else {
# we will not reach this in raw-mode, therefore no decision here!
chomp $note;
$Space = " " x (($maxlen + $timelen) - $nlen - 16);
print C $LINE;
print C $LINE if ($conf{printlines});
print C "$L $NUMC$num$_NUMC $R$L$TIMEC$time$_TIMEC $Space$R\n";
print "\n";
print C $NOTEC . $note . $_NOTEC . "\n";
print C $LINE if ($count == 1);
print C $LINE if ($count == 1 && $conf{printlines});
}
}