Fix a handful of bugs
parent
490c8f4835
commit
23bc02dab6
|
|
@ -58,7 +58,6 @@
|
||||||
- fix listener scroll to
|
- fix listener scroll to
|
||||||
- { } H{ } [ ] tabular-output -- excess newline
|
- { } H{ } [ ] tabular-output -- excess newline
|
||||||
- multiple listener-run-files is broken
|
- multiple listener-run-files is broken
|
||||||
- word wrap in UI broken again
|
|
||||||
- table line styles
|
- table line styles
|
||||||
- x11 input methods
|
- x11 input methods
|
||||||
- roundoff is still not quite right with tracks
|
- roundoff is still not quite right with tracks
|
||||||
|
|
|
||||||
|
|
@ -97,15 +97,13 @@ strings vectors ;
|
||||||
|
|
||||||
: split-next, V{ } clone , ;
|
: split-next, V{ } clone , ;
|
||||||
|
|
||||||
: split-end, building get dup peek empty? [ pop* ] [ drop ] if ;
|
|
||||||
|
|
||||||
: (split) ( separator elt -- | separator: elt -- ? )
|
: (split) ( separator elt -- | separator: elt -- ? )
|
||||||
[ swap call ] keep swap
|
[ swap call ] keep swap
|
||||||
[ drop split-next, ] [ split,, ] if ; inline
|
[ drop split-next, ] [ split,, ] if ; inline
|
||||||
|
|
||||||
: split* ( seq separator -- split | separator: elt -- ? )
|
: split* ( seq separator -- split | separator: elt -- ? )
|
||||||
over >r
|
over >r
|
||||||
[ split-next, swap [ (split) ] each-with split-end, ]
|
[ split-next, swap [ (split) ] each-with ]
|
||||||
{ } make r> swap [ swap like ] map-with ; inline
|
{ } make r> swap [ swap like ] map-with ; inline
|
||||||
|
|
||||||
: split ( seq separators -- split )
|
: split ( seq separators -- split )
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ SYMBOL: stdio
|
||||||
swap stdio get with-nested-stream ;
|
swap stdio get with-nested-stream ;
|
||||||
|
|
||||||
: tabular-output ( grid style quot -- )
|
: tabular-output ( grid style quot -- )
|
||||||
-rot stdio get with-stream-table ;
|
swap stdio get with-stream-table ;
|
||||||
|
|
||||||
: print ( string -- ) stdio get stream-print ;
|
: print ( string -- ) stdio get stream-print ;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ M: sbuf stream-flush drop ;
|
||||||
|
|
||||||
M: plain-writer with-stream-table ( grid quot style stream -- )
|
M: plain-writer with-stream-table ( grid quot style stream -- )
|
||||||
[
|
[
|
||||||
nip swap
|
drop swap
|
||||||
[ [ swap string-out ] map-with ] map-with
|
[ [ swap string-out ] map-with ] map-with
|
||||||
flip [ format-column ] map-last
|
flip [ format-column ] map-last
|
||||||
flip [ " " join ] map
|
flip [ " " join ] map
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,12 @@ unit-test
|
||||||
[ { "a" "b" "c" "d" "e" "f" } ]
|
[ { "a" "b" "c" "d" "e" "f" } ]
|
||||||
[ "aXbYcXdYeXf" "XY" split ] unit-test
|
[ "aXbYcXdYeXf" "XY" split ] unit-test
|
||||||
|
|
||||||
|
[ { "" "" } ]
|
||||||
|
[ " " " " split ] unit-test
|
||||||
|
|
||||||
|
[ { "hey" } ]
|
||||||
|
[ "hey" " " split ] unit-test
|
||||||
|
|
||||||
[ "Hello world" t ] [ "Hello world\n" "\n" ?tail ] unit-test
|
[ "Hello world" t ] [ "Hello world\n" "\n" ?tail ] unit-test
|
||||||
[ "Hello world" f ] [ "Hello world" "\n" ?tail ] unit-test
|
[ "Hello world" f ] [ "Hello world" "\n" ?tail ] unit-test
|
||||||
[ "" t ] [ "\n" "\n" ?tail ] unit-test
|
[ "" t ] [ "\n" "\n" ?tail ] unit-test
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue