1{-# LANGUAGE OverloadedStrings #-}
11import qualified Reporting.Doc as D
12import qualified Reporting.Region as R
13import qualified Reporting.Render.Code as Code
29toDoc :: FilePath -> Report -> D.Doc
30toDoc filePath (Report title _ _ message) =
32 [ messageBar title filePath
39messageBar :: String -> FilePath -> D.Doc
40messageBar title filePath =
43 4 + length title + 1 + length filePath
45 D.dullcyan $ D.fromString $
47 ++ " " ++ replicate (max 1 (80 - usedSpace)) '-'
55toCodeSnippet :: Code.Source -> R.Region -> Maybe R.Region -> (D.Doc, D.Doc) -> D.Doc
56toCodeSnippet source region highlight (preHint, postHint) =
60 , Code.render source region highlight
65toCodePair :: Code.Source -> R.Region -> R.Region -> (D.Doc, D.Doc) -> (D.Doc, D.Doc, D.Doc) -> D.Doc
66toCodePair source r1 r2 (oneStart, oneEnd) (twoStart, twoMiddle, twoEnd) =
67 case Code.renderPair source r1 r2 of
68 Code.OneLine codeDocs ->
76 Code.TwoChunks code1 code2 ->
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