summaryrefslogtreecommitdiffstats
path: root/src/Buffer
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2014-08-01 13:32:21 +0200
committertv <tv@shackspace.de>2014-08-01 13:32:21 +0200
commite77e6af554f73dc6010d2b79cf5b5a0fd740cb98 (patch)
tree47b1fab345f00a0bf0185608292cce70f21d05f5 /src/Buffer
parent2e64126b4e49be4d87faacc1f7e1b0d1f131e774 (diff)
use count in execCommand (MotionCommand x)
Diffstat (limited to 'src/Buffer')
-rw-r--r--src/Buffer/Motion.hs38
1 files changed, 19 insertions, 19 deletions
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