1 USING: accessors ui.gadgets.editors ui.gadgets.editors.private
2 tools.test kernel io io.streams.plain definitions namespaces
3 ui.gadgets ui.gadgets.grids prettyprint documents ui.gestures
4 ui.gadgets.debug models documents.elements ui.gadgets.scrollers
5 ui.gadgets.line-support sequences ;
10 "foo bar" "editor" get set-editor-string
11 "editor" get one-line-elt select-elt
12 "editor" get gadget-selection
19 "foo bar\nbaz quux" "editor" get set-editor-string
20 "editor" get one-line-elt select-elt
21 "editor" get gadget-selection
28 "foo bar\nbaz quux" "editor" get set-editor-string
30 "editor" get position-caret
37 "bar\nbaz quux" "editor" get set-editor-string
38 { 0 3 } "editor" get caret>> set-model
39 "editor" get select-word
40 "editor" get gadget-selection
44 "hello" <model> <model-field> "field" set
47 [ "hello" ] [ "field" get field-model>> value>> ] unit-test
50 { "Hello world." } [ "Hello \n world." join-lines ] unit-test
51 { " Hello world. " } [ " Hello \n world. " join-lines ] unit-test
52 { " Hello world. Goodbye." } [ " Hello \n world. \n Goodbye." join-lines ] unit-test
54 { } [ <editor> com-join-lines ] unit-test
55 { } [ <editor> "A" over set-editor-string com-join-lines ] unit-test
56 { "A B" } [ <editor> "A\nB" over set-editor-string [ com-join-lines ] [ editor-string ] bi ] unit-test
57 { "A B\nC\nD" } [ <editor> "A\nB\nC\nD" over set-editor-string { 0 0 } over set-caret dup mark>caret [ com-join-lines ] [ editor-string ] bi ] unit-test
58 { "A\nB C\nD" } [ <editor> "A\nB\nC\nD" over set-editor-string { 1 0 } over set-caret dup mark>caret [ com-join-lines ] [ editor-string ] bi ] unit-test
59 { "A\nB\nC D" } [ <editor> "A\nB\nC\nD" over set-editor-string { 2 0 } over set-caret dup mark>caret [ com-join-lines ] [ editor-string ] bi ] unit-test
61 { 2 } [ <editor> 20 >>min-rows 20 >>min-cols pref-viewport-dim length ] unit-test
64 <editor> 20 >>min-rows 20 >>min-cols
65 dup pref-viewport-dim >>dim