summaryrefslogtreecommitdiffstats
path: root/src/Buffer
diff options
context:
space:
mode:
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