From e77e6af554f73dc6010d2b79cf5b5a0fd740cb98 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 1 Aug 2014 13:32:21 +0200 Subject: use count in execCommand (MotionCommand x) --- src/Buffer/Motion.hs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/Buffer/Motion.hs') diff --git a/src/Buffer/Motion.hs b/src/Buffer/Motion.hs index fa9e059..1333b78 100644 --- a/src/Buffer/Motion.hs +++ b/src/Buffer/Motion.hs @@ -9,20 +9,20 @@ import Buffer.Class -- TODO factor Count -- TODO various Vim gX data LeftRightMotion - = GotoLeft Int - | GotoRight Int + = GotoLeft + | GotoRight | GotoFirstChar -- | GotoFirstNonBlankChar | GotoEndOfLine -- XXX in Vi this can go downwards - | GotoColumn Int - -- | GotoFindLeft Int (Char -> Bool) -- TODO don't use functions here - -- | GotoFindRight Int (Char -> Bool) -- TODO ^ dto. - -- | GotillFindLeft Int Char - -- | GotillFindRight Int Char - -- | RepeatLastFind Int - -- | RepeatLastFindReverse Int - | WordsForward Int - | WordsBackward Int + | GotoColumn + -- | GotoFindLeft (Char -> Bool) -- TODO don't use functions here + -- | GotoFindRight (Char -> Bool) -- TODO ^ dto. + -- | GotillFindLeft Char + -- | GotillFindRight Char + -- | RepeatLastFind + -- | RepeatLastFindReverse + | WordsForward + | WordsBackward deriving (Show) @@ -73,11 +73,11 @@ wordsBackward i (ls, rs) = else b' -move :: LeftRightMotion -> Buffer -> Buffer -move (GotoLeft i) = gotoLeft i -move (GotoRight i) = gotoRight i -move GotoFirstChar = gotoFirstChar -move GotoEndOfLine = gotoEndOfLine -move (GotoColumn i) = gotoColumn i -move (WordsForward i) = wordsForward i -move (WordsBackward i) = wordsBackward i +move :: LeftRightMotion -> Int -> Buffer -> Buffer +move GotoLeft c = gotoLeft c +move GotoRight c = gotoRight c +move GotoFirstChar _ = gotoFirstChar -- TODO use count +move GotoEndOfLine _ = gotoEndOfLine -- TODO use count +move GotoColumn c = gotoColumn c +move WordsForward c = wordsForward c +move WordsBackward c = wordsBackward c -- cgit v1.2.3