ui.gadgets.editors: fix stack effect of change-caret quotation.

db4
John Benediktsson 2012-12-28 17:01:32 -08:00
parent 03cd5cd579
commit a46bcfe85c
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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 ;