From c8b7cdb720d60f31b6c83a54f65927265838a834 Mon Sep 17 00:00:00 2001 From: strangeloop Date: Wed, 14 Aug 2024 14:01:37 -0400 Subject: [PATCH] Some edge case handling in Accumulator --- .gitignore | 2 ++ Accumulator.tin | 17 +++++++++++------ Arm.tin | 4 ++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 230fd74..9873870 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +#* +.* .DS_Store Notes.org Archive/ diff --git a/Accumulator.tin b/Accumulator.tin index 85d3b83..573f38e 100644 --- a/Accumulator.tin +++ b/Accumulator.tin @@ -1,4 +1,7 @@ #echo {Loading duplicate accumulator.} +#script {screenheight} {tput lines} +#nop height of the terminal, minus the split for promps +#math {screenheight} {$screenheight[1] * -1 + 7} #variable prevline {} #variable matchcount {1} #unvariable checkprompt @@ -14,12 +17,14 @@ #buffer info {save} {buffersize}; #buffer find {%0} {pos}; #math {linesup} {($buffersize[+4] - $pos) * -1}; - #buffer clear {$linesup} {-1}; - #buffer refresh; - #math {matchcount} {$matchcount + 1}; - #math {color} {$matchcount % 8}; - #format {color} {<0%d8>} {$color}; - #substitute {%0} {%0 ${color}\(x${matchcount}\)${RESET}}; + #if {$linesup < 0 && $linesup > $screenheight} { + #buffer clear {$linesup} {-1}; + #buffer refresh; + #math {matchcount} {$matchcount + 1}; + #math {color} {$matchcount % 8}; + #format {color} {<0%d8>} {$color}; + #substitute {%0} {%0 ${color}\(x${matchcount}\)${RESET}}; + } } { #variable {prevline} {%0}; #variable {matchcount} {1}; diff --git a/Arm.tin b/Arm.tin index b9d576a..3b5a173 100644 --- a/Arm.tin +++ b/Arm.tin @@ -390,18 +390,22 @@ #nop Constants used throughout the scripts #read {$armdir/Globals.tin}; +#alias {rlglobals} { #read {$armdir/Globals.tin} } #nop General highlighting #read {$armdir/HL.tin}; +#alias {rlhl} { #read {$armdir/HL.tin} } #nop PC names #read {$armdir/PCs.tin}; +#alias {rlpc} { #read {$armdir/PCs.tin} } #nop External help file reading in second terminal #read {$armdir/Help.tin}; #nop Accumulate repeated lines into one line #read {$armdir/Accumulator.tin}; +#alias {rlacc} { #read {$armdir/Accumulator.tin} } #nop reload it all #alias {reconnect} {#read $armdir/Arm.tin} \ No newline at end of file