diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-12 18:23:25 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-12 18:23:25 +1000 |
commit | f8b484f638e813537b9b968cf65d378b900fbcee (patch) | |
tree | 708fd1b05770b2020b2b16cff165688a9256bc81 /pkg/gui/stash_panel.go | |
parent | 52b132fe01156d8c7654180d03e40726e18692cd (diff) |
don't use newlines at the end of panel buffers
Diffstat (limited to 'pkg/gui/stash_panel.go')
-rw-r--r-- | pkg/gui/stash_panel.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go index 9ca07717b..3a9fac8d4 100644 --- a/pkg/gui/stash_panel.go +++ b/pkg/gui/stash_panel.go @@ -2,6 +2,7 @@ package gui import ( "fmt" + "strings" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" @@ -14,10 +15,15 @@ func (gui *Gui) refreshStashEntries(g *gocui.Gui) error { panic(err) } gui.State.StashEntries = gui.GitCommand.GetStashEntries() - v.Clear() - for _, stashEntry := range gui.State.StashEntries { - fmt.Fprintln(v, stashEntry.DisplayString) + + displayStrings := make([]string, len(gui.State.StashEntries)) + for i, stashEntry := range gui.State.StashEntries { + displayStrings[i] = stashEntry.DisplayString } + + v.Clear() + fmt.Fprint(v, strings.Join(displayStrings, "\n")) + return gui.resetOrigin(v) }) return nil |