     ] with-scope ; inline
 
 : visible-lines ( editor -- seq )
-    \ first-visible-line get
-    \ last-visible-line get
-    rot control-value <slice> ;
+    [ \ first-visible-line get \ last-visible-line get ] dip
+    control-value <slice> ;
 
 : with-editor-translation ( n quot -- )
     [ line-translation origin get v+ ] dip with-translation ;

! Copyright (C) 2006, 2008 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays documents io kernel math models
namespaces make opengl opengl.gl sequences strings io.styles
math.vectors sorting colors combinators assocs math.order fry
calendar alarms ui.clipboards ui.commands ui.gadgets
ui.gadgets.borders ui.gadgets.buttons ui.gadgets.labels
ui.gadgets.scrollers ui.gadgets.theme ui.gadgets.wrappers
ui.render ui.gestures math.geometry.rect ;
IN: ui.gadgets.editors

TUPLE: editor < gadget

    [ font>> ] dip { 0 0 } draw-string ;

: first-visible-line ( editor -- n )
    [
        [ clip get rect-loc second origin get second - ] dip
        y>line
    ] keep model>> validate-line ;

: last-visible-line ( editor -- n )
    [
        [ clip get rect-extent nip second origin get second - ] dip
        y>line
    ] keep model>> validate-line 1+ ;

: with-editor ( editor quot -- )
    [
