mirror of https://git.sr.ht/~rabbits/left
Formatting
This commit is contained in:
parent
d084fc7876
commit
e3bad43c77
45
src/left.tal
45
src/left.tal
|
@ -279,13 +279,15 @@
|
|||
[ LIT2 00 -Mouse/state ] DEI NEQ #42 ADD ;cursor-icn <update-cursor>
|
||||
POP2 .Mouse/y DEI2 .Mouse/state DEI [ LIT &last $1 ]
|
||||
( | on drag )
|
||||
ANDk #01 NEQ ?&>no-drag
|
||||
OVR2 [ LIT2 &drag $2 ] SUB2 .scroll/ratio LDZ2 MUL2 <scroll-by-y> &>no-drag OVR #01 NEQ ?&>no-down
|
||||
ANDk #01 NEQ ?&no-drag
|
||||
OVR2 [ LIT2 &drag $2 ] SUB2 .scroll/ratio LDZ2 MUL2 <scroll-by-y>
|
||||
&no-drag OVR #01 NEQ ?&no-down
|
||||
( | cat button )
|
||||
OVR2 .scrollbar/height LDZ2 SUB2 #0020 SUB2 #0008 GTH2 ?{
|
||||
[ LIT2 00 -Mouse/state ] DEO
|
||||
toggle-categories }
|
||||
OVR2 ,&drag STR2 &>no-down POP ,&last STR
|
||||
OVR2 ,&drag STR2
|
||||
&no-down POP ,&last STR
|
||||
POP2 BRK
|
||||
|
||||
@on-mouse-navbar ( -> )
|
||||
|
@ -670,11 +672,11 @@
|
|||
@update-nav-search ( -- )
|
||||
get-eof ;text
|
||||
&>l ( -- )
|
||||
LDA2k [ LIT2 0a "@ ] NEQ2 ?&>no-flabel
|
||||
INC2k LDA2 [ LIT2 "@| ] NEQ2 ?&>no-flabel
|
||||
INC2k add-marker &>no-flabel ;search OVR2 sseg? #00 EQU ?&>no-find
|
||||
DUP2 add-marker &>no-find .nav/len LDZ #17 GTH ?&end
|
||||
INC2 GTH2k ?&>l
|
||||
LDA2k [ LIT2 0a "@ ] NEQ2 ?&no-flabel
|
||||
INC2k LDA2 [ LIT2 "@| ] NEQ2 ?&no-flabel
|
||||
INC2k add-marker &no-flabel ;search OVR2 sseg? #00 EQU ?&no-find
|
||||
DUP2 add-marker &no-find .nav/len LDZ #17 GTH ?&end
|
||||
INC2 GTH2k ?&>l
|
||||
&end POP2 POP2 !reqdraw-navbar
|
||||
|
||||
@add-marker ( addr* -- )
|
||||
|
@ -831,18 +833,18 @@
|
|||
( | reset always )
|
||||
[ LIT2 00 -state/rune ] STZ
|
||||
( | reset state on ws )
|
||||
LDAk #20 GTH ?&>no-ws
|
||||
LDAk #20 GTH ?&no-ws
|
||||
[ LIT2 00 -state/underline ] STZ
|
||||
[ LIT2 00 -state/label ] STZ
|
||||
&>no-ws ( | blocks )
|
||||
&no-ws ( | blocks )
|
||||
|
||||
DUP2 #0002 SUB2 LDAk #20 GTH ?&>no-wsa
|
||||
DUP2 #0002 SUB2 LDAk #20 GTH ?&no-wsa
|
||||
INC2k LDA [ LIT 29 ] EQU ?&comment-end
|
||||
INC2k LDA [ LIT 5d ] EQU ?&block-end
|
||||
&>no-wsa INC2 LDAk #20 GTH ?&>no-wsb
|
||||
&no-wsa INC2 LDAk #20 GTH ?&no-wsb
|
||||
INC2k LDA [ LIT 28 ] EQU ?&comment-start
|
||||
INC2k LDA [ LIT 5b ] EQU ?&block-start
|
||||
&>no-wsb POP2
|
||||
&no-wsb POP2
|
||||
( | after ws )
|
||||
.state/comment LDZ ?&>skip
|
||||
DUP2 #0001 SUB2 LDA #20 GTH ?&>skip
|
||||
|
@ -871,9 +873,9 @@
|
|||
JMP2r
|
||||
|
||||
@get-color ( addr* -- addr* color )
|
||||
DUP2 get-from LTH2 ?&>no-selected
|
||||
DUP2 get-from LTH2 ?&no-selected
|
||||
DUP2 get-to LTH2 ?&selected
|
||||
&>no-selected .state/match LDZ ?&label
|
||||
&no-selected .state/match LDZ ?&label
|
||||
.textarea/highlight LDZ ?&skip
|
||||
.state/comment LDZ ?&comment
|
||||
.state/label LDZ ?&label
|
||||
|
@ -973,8 +975,9 @@
|
|||
get-from LDA2 [ LIT2 ".. ] EQU2 ?go-directory
|
||||
get-length #0001 GTH2 ?{ JMP2r }
|
||||
( | append to path, if path is folder )
|
||||
[ LITr -filepath ] #00 STHkr scap/ #0001 SUB2 LDAk LIT "/ NEQ ?&>no-append
|
||||
POPr INCk STH &>no-append POP2 <clear-filepath>
|
||||
[ LITr -filepath ] #00 STHkr scap/ #0001 SUB2 LDAk LIT "/ NEQ ?&no-append
|
||||
POPr INCk STH
|
||||
&no-append POP2 <clear-filepath>
|
||||
( | copy selection to filepath )
|
||||
get-to get-from
|
||||
&>w ( -- )
|
||||
|
@ -1166,10 +1169,10 @@
|
|||
@transform-clip ( -- )
|
||||
[ LITr 00 ] get-to get-from
|
||||
&>l ( -- )
|
||||
LDAk #20 NEQ ?&>no-ws
|
||||
INC2k wlen NIP STHkr ADD #50 LTH ?&>no-ws
|
||||
STH2k #0a STH2r STA
|
||||
POPr LITr 00 &>no-ws INC2 INC2r GTH2k ?&>l
|
||||
LDAk #20 NEQ ?&no-ws
|
||||
INC2k wlen NIP STHkr ADD #50 LTH ?&no-ws
|
||||
STH2k #0a STH2r STA
|
||||
POPr LITr 00 &no-ws INC2 INC2r GTH2k ?&>l
|
||||
POP2 POP2 POPr update-nav !reqdraw-textarea
|
||||
|
||||
@transform-join ( -- )
|
||||
|
|
Loading…
Reference in New Issue