summaryrefslogtreecommitdiff
path: root/Pancake.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-11-09 00:35:04 +0300
committerdefanor <defanor@uberspace.net>2017-11-09 00:35:04 +0300
commit074ac6af53c750039f6b32d6fb8ba0371fa4771d (patch)
treef604e0a18daf6c9815434b95156a189af88af2eb /Pancake.hs
parentcb07ecb166d47be2ac7915f0e8605f970ba35532 (diff)
pancake.el: prompt for input on RET
This is useful mostly for backward search. Also ignore empty lines in embedded mode in pancake itself, and add a "pancake>" prompt.
Diffstat (limited to 'Pancake.hs')
-rw-r--r--Pancake.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Pancake.hs b/Pancake.hs
index ab27ed6..a2c37f8 100644
--- a/Pancake.hs
+++ b/Pancake.hs
@@ -190,12 +190,12 @@ command Forward = do
_ -> liftIO $ putErrLn "Nowhere to go"
command More = do
st <- get
- term <- liftIO setupTermFromEnv
- let lineCount' = fromMaybe 25 (getCapability term termLines)
- lineCount = lineCount' - div lineCount' 3
- showLines $ take lineCount $ drop (position st) (rLines $ rendered st)
- modify (\s -> s { position = position st + lineCount })
- pure ()
+ unless (embedded st) $ do
+ term <- liftIO setupTermFromEnv
+ let lineCount' = fromMaybe 25 (getCapability term termLines)
+ lineCount = lineCount' - div lineCount' 3
+ showLines $ take lineCount $ drop (position st) (rLines $ rendered st)
+ modify (\s -> s { position = position st + lineCount })
command Reload = do
st <- get
case history st of