More work on correct handling of selection

parent 23c4f2ca
......@@ -176,9 +176,6 @@ end-class edit-actor
' false edit-actor is edit-next-line
' false edit-actor is edit-prev-line
: edit-paste ( max span addr pos1 - max span addr pos2 false )
clipboard@ insert-string edit-update 0 ;
0 value xselw
: edit-copy ( max span addr pos1 -- max span addr pos1 false )
......@@ -194,6 +191,14 @@ end-class edit-actor
: edit-del ( max span addr pos1 -- max span addr pos1 false )
xselw 0> IF edit-cut ELSE <xdel> THEN ;
: edit-ins$ ( max span addr pos1 addr u -- max span' addr pos1' )
xselw 0> IF save-mem 2>r edit-cut drop 2r@ insert-string
2r> drop free throw
ELSE insert-string THEN ;
: edit-paste ( max span addr pos1 - max span addr pos2 false )
clipboard@ edit-ins$ edit-update 0 ;
' edit-next-line ctrl N bindkey
' edit-prev-line ctrl P bindkey
' edit-paste ctrl V bindkey
......@@ -297,7 +302,7 @@ edit-terminal edit-out !
[: 4 roll dup $80000000 and 0= k-ctrl-mask and invert and
>control edit-control drop ;] edit-xt ; edit-actor is ekeyed
:noname ( addr u o:actor -- )
[: 2rot insert-string edit-update ;] edit-xt ; edit-actor is ukeyed
[: 2rot edit-ins$ edit-update ;] edit-xt ; edit-actor is ukeyed
:noname ( o:actor -- )
edit-w >o -1 to cursize o> need-sync on
need-keyboard off ; edit-actor is defocus
......@@ -332,7 +337,7 @@ edit-terminal edit-out !
o>
endof
2 of drop fdrop edit>curpos
[: primary@ insert-string ;] edit-xt endof
[: primary@ edit-ins$ ;] edit-xt endof
4 of ( menu ) drop fdrop fdrop endof
nip fdrop fdrop
endcase
......
......@@ -433,7 +433,7 @@ Defer android-key ' key>event is recurse
: android-log$ ( string -- ) jstring>sstring ." log: " type cr jfree ;
Defer android-w! ( n -- ) ' drop is recurse
Defer android-h! ( n -- ) ' drop is recurse
Defer clipboard! ( 0 -- ) ' drop is recurse
Defer clipboard-changed ( 0 -- ) ' drop is recurse
: android-config! ( n -- ) to screen-orientation config-changed ;
Defer android-active
......@@ -465,7 +465,7 @@ Create aevents
' android-setstring ,
' android-w! ,
' android-h! ,
' clipboard! , \ primary clipboard changed
' clipboard-changed , \ primary clipboard changed
' android-config! ,
' android-active ,
' android-setcur ,
......
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