]> gitweb.factorcode.org Git - factor.git/commitdiff
listener: if prompt is empty, then don't stream-bl
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 10 Jan 2022 19:29:09 +0000 (11:29 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 10 Jan 2022 19:29:09 +0000 (11:29 -0800)
basis/listener/listener.factor

index a8ecf642aae75c064405b46ba34342fcbb760ad7..717b459516aef215b6e25b6b1a5bef9fbd1ac4e5 100644 (file)
@@ -12,7 +12,7 @@ GENERIC#: prompt. 1 ( stream prompt -- )
 
 : prompt ( -- str )
     manifest get current-vocab>> [ name>> "IN: " prepend ] [ "" ] if*
-    auto-use? get [ " auto-use" append ] when ;
+    auto-use? get [ dup empty? "" " " ? "auto-use" 3append ] when ;
 
 SYMBOL: prompt-style
 H{
@@ -21,7 +21,7 @@ H{
 } prompt-style set-global
 
 M: object prompt.
-    nip prompt-style get-global format bl flush ;
+    nip [ prompt-style get-global format bl ] unless-empty ;
 
 SYMBOL: handle-ctrl-break
 
@@ -126,7 +126,7 @@ t error-summary? set-global
     visible-vars.
     datastack datastack.
     input-stream get prompt prompt.
-
+    flush
     [
         read-quot [
             '[ [ datastack _ with-datastack ] with-ctrl-break ]