version 1.45, 2006/02/19 15:13:38
|
version 1.50, 2006/12/31 13:39:13
|
Line 1
|
Line 1
|
\ command line edit and history support 16oct94py |
\ command line edit and history support 16oct94py |
|
|
\ Copyright (C) 1995,2000,2003,2004,2005 Free Software Foundation, Inc. |
\ Copyright (C) 1995,2000,2003,2004,2005,2006 Free Software Foundation, Inc. |
|
|
\ This file is part of Gforth. |
\ This file is part of Gforth. |
|
|
Line 72 s" os-class" environment? [IF] s" unix"
|
Line 72 s" os-class" environment? [IF] s" unix"
|
defer back-restore ( u -- ) |
defer back-restore ( u -- ) |
' backspaces is back-restore |
' backspaces is back-restore |
|
|
|
[IFDEF] x-width |
|
: clear-line ( max span addr pos1 -- max addr ) |
|
back-restore over over swap x-width spaces swap back-restore ; |
|
[ELSE] |
: clear-line ( max span addr pos1 -- max addr ) |
: clear-line ( max span addr pos1 -- max addr ) |
back-restore over spaces swap back-restore ; |
back-restore over spaces swap back-restore ; |
|
[THEN] |
\ : clear-tib ( max span addr pos -- max 0 addr 0 false ) |
\ : clear-tib ( max span addr pos -- max 0 addr 0 false ) |
\ clear-line 0 tuck dup ; |
\ clear-line 0 tuck dup ; |
|
|
Line 277 require utf-8.fs
|
Line 281 require utf-8.fs
|
['] xclear-tib ctrl K bindkey |
['] xclear-tib ctrl K bindkey |
['] xfirst-pos ctrl A bindkey |
['] xfirst-pos ctrl A bindkey |
['] xend-pos ctrl E bindkey |
['] xend-pos ctrl E bindkey |
['] (xenter) #lf bindkey |
history IF ['] (xenter) #lf bindkey THEN |
['] (xenter) #cr bindkey |
history IF ['] (xenter) #cr bindkey THEN |
['] xtab-expand #tab bindkey |
['] xtab-expand #tab bindkey |
['] (xins) IS insert-char |
['] (xins) IS insert-char |
['] kill-prefix IS everychar |
['] kill-prefix IS everychar |
Line 295 xchar-history
|
Line 299 xchar-history
|
?dup-if |
?dup-if |
\ !! >stderr |
\ !! >stderr |
\ history-file type ." : " .error cr |
\ history-file type ." : " .error cr |
drop 2drop |
drop 2drop 0 to history |
['] false ['] false ['] (ret) |
['] false ['] false ['] (ret) |
else |
else |
to history |
to history |
Line 312 xchar-history
|
Line 316 xchar-history
|
: history-cold ( -- ) |
: history-cold ( -- ) |
history-file get-history xchar-history ; |
history-file get-history xchar-history ; |
|
|
' history-cold INIT8 chained |
:noname ( -- ) |
|
defers 'cold |
|
history-cold |
|
; is 'cold |
|
|
history-cold |
history-cold |
|
|