Verified Commit 3a8d70a6 authored by Bernd Paysan's avatar Bernd Paysan
Browse files

Status Line

parent 8f78c629
Pipeline #1246 passed with stage
in 10 minutes and 42 seconds
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
: .scanning ( -- ) : .scanning ( -- )
." scanning for [THEN]" cr ; ." scanning for [THEN]" cr ;
Defer .unstatus ' noop is .unstatus
:noname ( in 1 -- ) 1 <> -12 and throw >in ! ; :noname ( in 1 -- ) 1 <> -12 and throw >in ! ;
\ restore-input \ restore-input
...@@ -41,6 +42,7 @@ ...@@ -41,6 +42,7 @@
[ has? file [IF] ] stdin file-eof? IF false EXIT THEN [ [THEN] ] [ has? file [IF] ] stdin file-eof? IF false EXIT THEN [ [THEN] ]
scanning? IF ['] .scanning warning-color color-execute THEN scanning? IF ['] .scanning warning-color color-execute THEN
tib max#tib @ accept #tib ! tib max#tib @ accept #tib !
.unstatus
input-start-line true 1 loadline +! ; \ refill input-start-line true 1 loadline +! ; \ refill
:noname ( -- addr u ) tib #tib @ ; \ source :noname ( -- addr u ) tib #tib @ ; \ source
......
...@@ -944,7 +944,7 @@ Defer 'cold ( -- ) \ gforth tick-cold ...@@ -944,7 +944,7 @@ Defer 'cold ( -- ) \ gforth tick-cold
has? os [IF] has? os [IF]
: bye ( -- ) \ tools-ext : bye ( -- ) \ tools-ext
[ has? file [IF] ] [ has? file [IF] ]
script? 0= IF cr THEN script? 0= IF .unstatus cr THEN
[ [ELSE] ] [ [ELSE] ]
cr cr
[ [THEN] ] [ [THEN] ]
......
...@@ -19,14 +19,23 @@ ...@@ -19,14 +19,23 @@
\ along with this program. If not, see http://www.gnu.org/licenses/. \ along with this program. If not, see http://www.gnu.org/licenses/.
blue >bg white >fg or bold or Value status-attr blue >bg white >fg or bold or Value status-attr
: redraw-status ( addr u -- )
.\" \e7"
0 rows 2 - at-xy cols 2* spaces .\" \e[A\n"
status-attr attr! type default-color attr!
.\" \e8" ;
: .unstatus-line ( -- )
.\" \e7"
0 rows 1 - at-xy cols spaces
.\" \e8" ;
: .status-line ( -- ) { | w^ status$ } : .status-line ( -- ) { | w^ status$ }
base @ base @
[: ." gforth 😷 | " unused u. [: ." gforth 😷 | " unused 1024 / 0 u.r
." free | order: " order ." k free | order: " order
." | base=" . ." | base=" .
." | " depth 0= IF ." ∅" ELSE ... THEN ;] ." | " depth 0= IF ." ∅" ELSE ... THEN ;]
[: ." gforth 😷 | " unused u. [: ." gforth 😷 | " unused 1024 / 0 u.r
." f|o " order ." k free|o " order
." |b=" 0 .r ." |b=" 0 .r
." | " depth 0= IF ." ∅" ELSE ... THEN ;] ." | " depth 0= IF ." ∅" ELSE ... THEN ;]
cols 100 > select cols 100 > select
...@@ -42,10 +51,10 @@ blue >bg white >fg or bold or Value status-attr ...@@ -42,10 +51,10 @@ blue >bg white >fg or bold or Value status-attr
r> I - +LOOP drop r> I - +LOOP drop
THEN THEN
THEN THEN
.\" \n\n\e[2A\e7" .\" \n\n\e[2A" status$ $@ redraw-status
0 rows 2 - at-xy cols spaces cr
status-attr attr! status$ $. default-color attr!
.\" \e8"
status$ $free ; status$ $free ;
' .status-line is .status : +status ['] .status-line is .status ['] .unstatus-line is .unstatus ;
: -status ['] noop is .status ['] noop is .unstatus ;
+status
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment