diff options
Diffstat (limited to 'app/History/CommitHash.hs')
-rw-r--r-- | app/History/CommitHash.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/History/CommitHash.hs b/app/History/CommitHash.hs index f1b8283..cbe4db1 100644 --- a/app/History/CommitHash.hs +++ b/app/History/CommitHash.hs @@ -8,6 +8,7 @@ where import Data.Binary (Binary) import Data.Text qualified as T import GHC.Generics (Generic) +import Render qualified as P data CommitHash = WorkingTree @@ -21,3 +22,16 @@ toShortText (Commit hash) = T.take 7 hash toText :: CommitHash -> T.Text toText WorkingTree = "<dirty>" toText (Commit hash) = hash + +instance P.Render CommitHash where + render = P.render . P.Detailed + +instance P.Render (P.Detailed CommitHash) where + render (P.Detailed commitHash) = + P.styled [P.color P.Yellow] $ + P.render (toText commitHash) + +instance P.Render (P.Summarized CommitHash) where + render (P.Summarized commitHash) = + P.styled [P.color P.Yellow] $ + P.render (toShortText commitHash) |