diff options
author | Fabian Kirchner <kirchner@posteo.de> | 2023-10-13 20:05:41 +0200 |
---|---|---|
committer | Fabian Kirchner <kirchner@posteo.de> | 2023-10-13 20:05:41 +0200 |
commit | 3e4f959560deb7618a9109314c3d41c162c33c76 (patch) | |
tree | 279279793ac508fa6218060b84e759cc1bf7b86f | |
parent | e374dfe4a9e508d571ce50924d274a4390965189 (diff) |
print file and row in show mode
-rw-r--r-- | app/Issue.hs | 2 | ||||
-rw-r--r-- | app/Main.hs | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/app/Issue.hs b/app/Issue.hs index 0e3ac2b..a222d0a 100644 --- a/app/Issue.hs +++ b/app/Issue.hs @@ -20,6 +20,7 @@ import Prelude hiding (id) data Issue = Issue { title :: Text, description :: Maybe Text, + file :: String, start :: G.Position, end :: G.Position, tags :: [Tag], @@ -42,6 +43,7 @@ fromMatch result match = Issue { title = title, description = description, + file = result.file, start = match.start, end = match.end, tags = maybe [] I.extractTags description, diff --git a/app/Main.hs b/app/Main.hs index 947ab85..0cb5036 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -187,7 +187,14 @@ main = do issues <- listIssues [] [] case find ((==) (Just id) . I.id) issues of Nothing -> die (printf "no issue with id `%s'\n" id) - Just issue -> + Just issue -> do + putDoc $ + P.annotate (P.color P.Green) $ + P.pretty $ + issue.file + ++ ":" + ++ show issue.start.row + ++ "\n\n" sh_ ( P.setStdin ( String.fromString @@ -202,6 +209,13 @@ main = do -- @topic formatting "mdcat --columns 80 --local" ) + putDoc $ + P.pretty $ + "\n@file " + ++ issue.file + ++ "\n@row " + ++ show issue.start.row + ++ "\n" putDoc :: P.Doc P.AnsiStyle -> IO () putDoc doc = do |