logging durations and more stuff

This commit is contained in:
Jesse Duffield
2018-06-02 08:35:49 +10:00
parent a555a75565
commit 103a6fd219
10 changed files with 73 additions and 93 deletions

27
gui.go
View File

@@ -1,9 +1,3 @@
// lots of this has been directly ported from one of the example files, will brush up later
// Copyright 2014 The gocui Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
@@ -11,7 +5,6 @@ import (
// "io"
// "io/ioutil"
"fmt"
"log"
// "strings"
@@ -181,26 +174,6 @@ func handleLogState(g *gocui.Gui, v *gocui.View) error {
return nil
}
func refreshStatus(g *gocui.Gui) error {
v, err := g.View("status")
if err != nil {
return err
}
v.Clear()
up, down := gitUpstreamDifferenceCount()
devLog(up, down)
fmt.Fprint(v, "↑"+up+"↓"+down)
branches := state.Branches
if len(branches) == 0 {
return nil
}
branch := branches[0]
// utilising the fact these all have padding to only grab the name
// from the display string with the existing coloring applied
fmt.Fprint(v, " "+branch.DisplayString[4:])
return nil
}
func layout(g *gocui.Gui) error {
width, height := g.Size()
leftSideWidth := width / 3