version 1.53, 2007/05/05 17:30:23
|
version 1.54, 2007/06/07 20:57:13
|
Line 200 require utf-8.fs
|
Line 200 require utf-8.fs
|
|
|
Variable curpos |
Variable curpos |
|
|
|
s" os-type" environment? [IF] s" cygwin" str= [IF] |
|
: save-cursor ( -- ) #esc emit '7 emit ; |
|
: restore-cursor ( -- ) #esc emit '8 emit ; |
|
: cur-correct ( addr u -- ) 2drop ; |
|
[ELSE] |
: at-xy? ( -- x y ) |
: at-xy? ( -- x y ) |
key? drop |
key? drop |
#esc emit ." [6n" 0 0 |
#esc emit ." [6n" 0 0 |
Line 212 Variable curpos
|
Line 217 Variable curpos
|
: cursor! ( n -- ) form nip /mod at-xy ; |
: cursor! ( n -- ) form nip /mod at-xy ; |
: cur-correct ( addr u -- ) x-width curpos @ + cursor@ - |
: cur-correct ( addr u -- ) x-width curpos @ + cursor@ - |
form nip >r r@ 2/ + r@ / r> * negate curpos +! ; |
form nip >r r@ 2/ + r@ / r> * negate curpos +! ; |
|
|
: save-cursor ( -- ) cursor@ curpos ! ; |
: save-cursor ( -- ) cursor@ curpos ! ; |
: restore-cursor ( -- ) curpos @ cursor! ; |
: restore-cursor ( -- ) curpos @ cursor! ; |
|
[THEN] |
: .rest ( addr pos1 -- addr pos1 ) |
: .rest ( addr pos1 -- addr pos1 ) |
key? ?EXIT |
key? ?EXIT |
restore-cursor 2dup type 2dup cur-correct ; |
restore-cursor 2dup type 2dup cur-correct ; |