1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

add stash panel

This commit is contained in:
Jesse Duffield
2018-06-05 18:48:46 +10:00
parent 164ac72c5a
commit d1ead5b0cf
4 changed files with 192 additions and 31 deletions

View File

@ -18,7 +18,9 @@ func returnFocus(g *gocui.Gui, v *gocui.View) error {
}
func switchFocus(g *gocui.Gui, oldView, newView *gocui.View) error {
if oldView != nil {
// we assume we'll never want to return focus to a confirmation panel i.e.
// we should never stack confirmation panels
if oldView != nil && oldView.Name() != "confirmation" {
oldView.Highlight = false
devLog("setting previous view to:", oldView.Name())
state.PreviousView = oldView.Name()
@ -38,6 +40,10 @@ func getItemPosition(v *gocui.View) int {
return oy + cy
}
func trimmedContent(v *gocui.View) string {
return strings.TrimSpace(v.Buffer())
}
func cursorUp(g *gocui.Gui, v *gocui.View) error {
if v == nil {
return nil
@ -94,6 +100,7 @@ func correctCursor(v *gocui.View) error {
func renderString(g *gocui.Gui, viewName, s string) error {
g.Update(func(*gocui.Gui) error {
timeStart := time.Now()
colorLog(color.FgRed, viewName)
v, err := g.View(viewName)
if err != nil {
panic(err)