File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -251,16 +251,25 @@ func issueView(cmd *cobra.Command, args []string) error {
251251func printIssuePreview (out io.Writer , issue * api.Issue ) error {
252252 coloredLabels := labelList (* issue )
253253 if coloredLabels != "" {
254- coloredLabels = utils . Gray ( fmt .Sprintf ("(%s) " , coloredLabels ) )
254+ coloredLabels = fmt .Sprintf ("%s " , coloredLabels )
255255 }
256256
257+ now := time .Now ()
258+ ago := now .Sub (issue .CreatedAt )
259+ issueStateColorFunc := utils .ColorFuncForState (issue .State )
260+
257261 fmt .Fprintln (out , utils .Bold (issue .Title ))
258- fmt .Fprintln (out , utils .Gray (fmt .Sprintf (
259- "opened by %s. %s. %s" ,
262+ fmt .Fprintf (out , "%s" , issueStateColorFunc (issue .State ))
263+ fmt .Fprint (out , utils .Gray (fmt .Sprintf (
264+ " • %s opened %s • %s • " ,
260265 issue .Author .Login ,
266+ utils .FuzzyAgo (ago ),
261267 utils .Pluralize (issue .Comments .TotalCount , "comment" ),
262- coloredLabels ,
263268 )))
269+ if coloredLabels != "" {
270+ fmt .Fprintf (out , "%s" , utils .Gray (coloredLabels ))
271+ }
272+ fmt .Fprintf (out , "\n " )
264273
265274 if issue .Body != "" {
266275 fmt .Fprintln (out )
You can’t perform that action at this time.
0 commit comments