X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/blobdiff_plain/bb6b2dcdd9acffabfd373c4c3f6b64a9cc43f335..90975d261c7ab39186c75d8700261faab3427de7:/fth/history.fth diff --git a/fth/history.fth b/fth/history.fth index dfb7baa..574d6a6 100644 --- a/fth/history.fth +++ b/fth/history.fth @@ -50,6 +50,8 @@ KH-HISTORY kh_history_size erase \ \ The most recent entry is put at the beginning, \ older entries are shifted up. + +4 constant KH_LINE_EXTRA_SIZE ( 2 count bytes plus 2 size bytes ) : KH-END ( -- addr , end of history buffer ) kh-history kh_history_size + @@ -131,8 +133,10 @@ variable KH-INSIDE ( true if we are scrolling inside the history buffer ) ELSE >r ( save count ) \ Set look pointer to point to first count byte of last string. - 0 kh-look ! - r@ cell+ kh.make.room + 0 kh-look ! +\ Make room for this line of text and line header. +\ PLB20100823 Was cell+ which broke on 64-bit code. + r@ KH_LINE_EXTRA_SIZE + kh.make.room \ Set count bytes at beginning and end. r@ kh-history c! ( start count ) r@ kh.endcount.addr c! @@ -421,9 +425,9 @@ variable KH-INSIDE ( true if we are scrolling inside the history buffer ) kh.inschar REPEAT drop kh-span @ kh-cursor @ - ?dup - IF 1+ tio.forwards ( move to end of line ) - ELSE space + IF tio.forwards ( move to end of line ) THEN + space flushemit ;