1{-# LANGUAGE OverloadedStrings #-}
2module Reporting.Region where
4import Data.Aeson ((.=))
5import qualified Data.Aeson as Json
29merge :: Region -> Region -> Region
30merge (Region start _) (Region _ end) =
38toString :: Region -> String
39toString (Region (Position startLine startColumn) (Position endLine endColumn)) =
40 case startLine == endLine of
42 "between lines " ++ show startLine
43 ++ " and " ++ show endLine
46 "on line " ++ show endLine ++ ", column "
47 ++ show startColumn ++ " to " ++ show endColumn
54instance Json.ToJSON Region where
55 toJSON (Region start end) =
62instance Json.ToJSON Position where
63 toJSON (Position line column) =
74instance Binary Region where
76 Region <$> get <*> get
78 put (Region start end) =
83instance Binary Position where
85 Position <$> get <*> get
87 put (Position line column) =
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list