--- gforth/history.fs 2007/06/30 23:00:14 1.58 +++ gforth/history.fs 2007/07/19 13:28:18 1.62 @@ -203,9 +203,13 @@ require utf-8.fs Variable curpos Variable screenw +: at-deltaxy ( dx dy -- ) + #esc emit '[ emit dup abs 0 .r 0< IF 'A ELSE 'B THEN emit + #esc emit '[ emit dup abs 0 .r 0< IF 'D ELSE 'C THEN emit ; + : cygwin? ( -- flag ) s" TERM" getenv s" cygwin" str= ; : at-xy? ( -- x y ) - key? drop + key? drop \ make sure prep_terminal() is executed #esc emit ." [6n" 0 0 BEGIN key dup 'R <> WHILE dup '; = IF drop swap ELSE @@ -239,7 +243,7 @@ Variable screenw : xretype ( max span addr pos1 -- max span addr pos1 ) restore-cursor screenw @ >r save-cursor - .all 2 pick r@ / 1+ screenw @ r> - * 0 max spaces .rest false ; + .all 2 pick r@ / screenw @ r> - * 0 max spaces .rest false ; \ In the following, addr max is the buffer, addr span is the current \ string in the buffer, and pos1 is the cursor position in the buffer. @@ -319,7 +323,7 @@ Variable screenw ['] xclear-tib ctrl K bindkey ['] xfirst-pos ctrl A bindkey ['] xend-pos ctrl E bindkey - ['] xretype bl bindkey + ['] xretype ctrl L bindkey history IF ['] (xenter) #lf bindkey THEN history IF ['] (xenter) #cr bindkey THEN ['] xtab-expand #tab bindkey