From e5e693b69e523bac9eff3a76b901e25ab8897e09 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 28 Jul 2014 03:19:32 +0200 Subject: rm obsolete commands Insert*{Verbatim,ChangeMode} --- Main.hs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'Main.hs') 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 -- cgit v1.2.3