     [ draw-selected-line ] [ nip draw-unselected-line ] if ;
 
 M: editor draw-gadget*
-    dup compute-selection selected-lines [
-        [ draw-lines ] [ draw-caret ] bi
-    ] with-variable ;
+    dup draw-default-text? [
+        [ draw-default-text ] [ draw-caret ] bi
+    ] [
+        dup compute-selection selected-lines [
+            [ draw-lines ] [ draw-caret ] bi
+        ] with-variable
+    ] if ;
 
 M: editor pref-dim*
     ! Add some space for the caret.
-    [ font>> ] [ control-value ] bi text-dim { 1 0 } v+ ;
+    [ font>> ] keep dup draw-default-text?
+    [ default-text>> ] [ control-value ] if
+    text-dim { 1 0 } v+ ;
 
 M: editor baseline font>> font-metrics ascent>> ;
 

TUPLE: editor < line-gadget
    caret-color
    caret mark
    focused? blink blink-timer ;

<PRIVATE


        ] 3bi
    ] if ;

: draw-default-text? ( editor -- ? )
    { [ default-text>> ] [ model>> doc-string empty? ] } 1&& ;

: draw-default-text ( editor -- )
    [ font>> clone line-color >>foreground ]
    [ default-text>> ] bi draw-text ;

PRIVATE>

M: editor draw-line ( line index editor -- )
