ui.gadgets.editors: fix stack effect of change-caret quotation.
parent
03cd5cd579
commit
a46bcfe85c
|
@ -32,7 +32,7 @@ HELP: editor-mark
|
|||
{ $description "Outputs the current mark location as a line/column number pair." } ;
|
||||
|
||||
HELP: change-caret
|
||||
{ $values { "editor" editor } { "quot" { $quotation "( loc -- newloc )" } } }
|
||||
{ $values { "editor" editor } { "quot" { $quotation "( loc document -- newloc )" } } }
|
||||
{ $description "Applies a quotation to the current caret location and moves the caret to the location output by the quotation." } ;
|
||||
|
||||
{ change-caret change-caret&mark mark>caret } related-words
|
||||
|
@ -42,7 +42,7 @@ HELP: mark>caret
|
|||
{ $description "Moves the mark to the caret location, effectively deselecting any selected text." } ;
|
||||
|
||||
HELP: change-caret&mark
|
||||
{ $values { "editor" editor } { "quot" { $quotation "( loc -- newloc )" } } }
|
||||
{ $values { "editor" editor } { "quot" { $quotation "( loc document -- newloc )" } } }
|
||||
{ $description "Applies a quotation to the current caret location and moves the caret and the mark to the location output by the quotation." } ;
|
||||
|
||||
HELP: point>loc
|
||||
|
|
|
@ -96,14 +96,14 @@ M: editor ungraft*
|
|||
: set-caret ( loc editor -- )
|
||||
[ model>> validate-loc ] [ caret>> ] bi set-model ;
|
||||
|
||||
: change-caret ( editor quot -- )
|
||||
: change-caret ( editor quot: ( loc document -- newloc ) -- )
|
||||
[ [ [ editor-caret ] [ model>> ] bi ] dip call ] [ drop ] 2bi
|
||||
set-caret ; inline
|
||||
|
||||
: mark>caret ( editor -- )
|
||||
[ editor-caret ] [ mark>> ] bi set-model ;
|
||||
|
||||
: change-caret&mark ( editor quot -- )
|
||||
: change-caret&mark ( editor quot: ( loc document -- newloc ) -- )
|
||||
[ change-caret ] [ drop mark>caret ] 2bi ; inline
|
||||
|
||||
: editor-line ( n editor -- str ) control-value nth ;
|
||||
|
|
Loading…
Reference in New Issue