--- gforth/history.fs 2006/02/19 15:11:22 1.44 +++ gforth/history.fs 2006/11/28 09:37:33 1.49 @@ -72,9 +72,13 @@ s" os-class" environment? [IF] s" unix" defer back-restore ( u -- ) ' backspaces is back-restore +[IFDEF] x-width : clear-line ( max span addr pos1 -- max addr ) - back-restore over spaces swap backspaces ; - + back-restore over over swap x-width spaces swap back-restore ; +[ELSE] +: clear-line ( max span addr pos1 -- max addr ) + back-restore over spaces swap back-restore ; +[THEN] \ : clear-tib ( max span addr pos -- max 0 addr 0 false ) \ clear-line 0 tuck dup ; @@ -277,8 +281,8 @@ require utf-8.fs ['] xclear-tib ctrl K bindkey ['] xfirst-pos ctrl A bindkey ['] xend-pos ctrl E bindkey - ['] (xenter) #lf bindkey - ['] (xenter) #cr bindkey + history IF ['] (xenter) #lf bindkey THEN + history IF ['] (xenter) #cr bindkey THEN ['] xtab-expand #tab bindkey ['] (xins) IS insert-char ['] kill-prefix IS everychar @@ -295,7 +299,7 @@ xchar-history ?dup-if \ !! >stderr \ history-file type ." : " .error cr - drop 2drop + drop 2drop 0 to history ['] false ['] false ['] (ret) else to history @@ -312,6 +316,10 @@ xchar-history : history-cold ( -- ) history-file get-history xchar-history ; -' history-cold INIT8 chained +:noname ( -- ) + defers 'cold + history-cold +; is 'cold + history-cold