Select line on reselection of word
This commit is contained in:
parent
564e6de863
commit
12e156ebec
|
@ -96,7 +96,9 @@
|
||||||
@on-mouse-body ( -> )
|
@on-mouse-body ( -> )
|
||||||
[ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;caret-icn <update-cursor>
|
[ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;caret-icn <update-cursor>
|
||||||
<trap-mouse>
|
<trap-mouse>
|
||||||
[ LIT &last $1 ] .Mouse/state DEI DUP #02 LTH ?{ get-position <select-word> }
|
[ LIT &last $1 ] .Mouse/state DEI DUP #02 LTH ?{
|
||||||
|
get-position <select-word>
|
||||||
|
[ LIT2 00 -Mouse/state ] DEO }
|
||||||
DUP2 #0001 NEQ2 ?{ get-position <select-variable> }
|
DUP2 #0001 NEQ2 ?{ get-position <select-variable> }
|
||||||
DUP2 #0101 NEQ2 ?{ get-position <select-to> }
|
DUP2 #0101 NEQ2 ?{ get-position <select-to> }
|
||||||
,&last STR
|
,&last STR
|
||||||
|
@ -177,10 +179,22 @@
|
||||||
!select
|
!select
|
||||||
|
|
||||||
@<select-word> ( addr* -- )
|
@<select-word> ( addr* -- )
|
||||||
DUP2 &back #0001 SUB2 LDAk #20 GTH ?&back
|
DUP2
|
||||||
INC2 .selection/a STZ2
|
&>back ( -- )
|
||||||
&next INC2 LDAk #20 GTH ?&next
|
#0001 SUB2 LDAk #20 GTH ?&>back
|
||||||
.selection/b STZ2
|
INC2 SWP2
|
||||||
|
&>next ( -- )
|
||||||
|
INC2 LDAk #20 GTH ?&>next
|
||||||
|
OVR2 OVR2 is-selection ?{
|
||||||
|
.selection/b STZ2
|
||||||
|
.selection/a STZ2
|
||||||
|
!select }
|
||||||
|
POP2
|
||||||
|
( >> )
|
||||||
|
|
||||||
|
@<select-line> ( addr* -- )
|
||||||
|
DUP2 find-line-start .selection/a STZ2
|
||||||
|
find-line-end .selection/b STZ2
|
||||||
!select
|
!select
|
||||||
|
|
||||||
@<select-all> ( -- )
|
@<select-all> ( -- )
|
||||||
|
@ -217,6 +231,10 @@
|
||||||
#01 JMP2r
|
#01 JMP2r
|
||||||
&false #00 JMP2r
|
&false #00 JMP2r
|
||||||
|
|
||||||
|
@is-selection ( a* b* -- f )
|
||||||
|
.selection/b LDZ2 EQU2 STH
|
||||||
|
.selection/a LDZ2 EQU2 STHr AND JMP2r
|
||||||
|
|
||||||
(
|
(
|
||||||
@|file )
|
@|file )
|
||||||
|
|
||||||
|
@ -370,7 +388,7 @@
|
||||||
POP2 STH2r JMP2r
|
POP2 STH2r JMP2r
|
||||||
|
|
||||||
@find-line-start ( addr* -- addr* )
|
@find-line-start ( addr* -- addr* )
|
||||||
;mem SWP2
|
;mem #0001 SUB2 SWP2
|
||||||
&>l ( -- )
|
&>l ( -- )
|
||||||
#0001 SUB2 LDAk DUP #0a EQU SWP #00 EQU ORA ?&end
|
#0001 SUB2 LDAk DUP #0a EQU SWP #00 EQU ORA ?&end
|
||||||
LTH2k ?&>l
|
LTH2k ?&>l
|
||||||
|
|
Loading…
Reference in New Issue