summaryrefslogtreecommitdiffstats
path: root/Main.hs
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2014-07-28 03:19:32 +0200
committertv <tv@shackspace.de>2014-07-28 03:19:32 +0200
commite5e693b69e523bac9eff3a76b901e25ab8897e09 (patch)
tree63c2ccc849b18e29837836b6ae85cab1d6b9e2e8 /Main.hs
parent014d7a59d6522febf639e3a0f3801271e9aec4ab (diff)
rm obsolete commands Insert*{Verbatim,ChangeMode}
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs18
1 files changed, 2 insertions, 16 deletions
diff --git a/Main.hs b/Main.hs
index 4f15418..275513c 100644
--- a/Main.hs
+++ b/Main.hs
@@ -114,8 +114,6 @@ uiThread modeRef lock = do
data Command
= AlertBadInput String
| InsertString String
- | InsertNextCharVerbatim
- | InsertStringThenChangeMode String Mode
| KillLastWord
| KillLastChar
| KillNextChar
@@ -211,24 +209,12 @@ execCommand (MotionCommand x) = do
when (null $ snd $ buffer q) $
modifyBuffer (gotoLeft 1)
-
execCommand (ChangeMode m) =
modify $ \ q -> q { mode = m }
execCommand (InsertString s) =
modifyBuffer (insertString s)
-execCommand (InsertStringThenChangeMode s m) =
- modify $ \ q -> q
- { mode = m
- , buffer = insertString s (buffer q)
- }
-
-execCommand InsertNextCharVerbatim =
- modify $ \ q -> q
- { mode = VerbatimMode
- }
-
execCommand ExecuteInputBuffer = do
b <- gets buffer
tell [ "input: <" ++ (concat $ map (reform 32) $ showBuffer b) ++ ">" ]
@@ -383,7 +369,7 @@ imap =
, ("\x1b[3~", KillNextChar)
, ("\x1b[C", MotionCommand $ GotoRight 1)
, ("\x1b[D", MotionCommand $ GotoLeft 1)
- , ("\x16", InsertNextCharVerbatim) -- ^V
+ , ("\x16", ChangeMode VerbatimMode) -- ^V
, ("\x17", KillLastWord) -- ^W
, ("\x0a", ExecuteInputBuffer)
, ("\x7f", KillLastChar) -- Delete
@@ -512,7 +498,7 @@ getCommandXXX keymap defCmd = do
verbatimKeymap :: IO Command
verbatimKeymap = do
c <- getChar
- return $ InsertStringThenChangeMode [c] NormalMode
+ return $ InsertString [c] <> ChangeMode InsertMode
-- TODO Control.Monad.whenLeft