diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-12-09 15:23:40 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-12-09 15:23:40 +0100 |
commit | a46f26e14823ab5282289ef460466bee422208bb (patch) | |
tree | 2b7863afc0811ea683382aa6c7c446890db01fcd /vendor/github.com | |
parent | ca4b8b25f0b873156a616f55fa50f837df37fcee (diff) |
Bump gocui
Diffstat (limited to 'vendor/github.com')
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/gui.go | 23 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/view.go | 4 |
2 files changed, 25 insertions, 2 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/gui.go b/vendor/github.com/jesseduffield/gocui/gui.go index 4bd5a7d76..80303fdca 100644 --- a/vendor/github.com/jesseduffield/gocui/gui.go +++ b/vendor/github.com/jesseduffield/gocui/gui.go @@ -1166,6 +1166,29 @@ func (g *Gui) flush() error { return nil } +func (g *Gui) ForceLayoutAndRedraw() error { + return g.flush() +} + +// force redrawing one or more views outside of the normal main loop. Useful during longer +// operations that block the main thread, to update a spinner in a status view. +func (g *Gui) ForceRedrawViews(views ...*View) error { + for _, m := range g.managers { + if err := m.Layout(g); err != nil { + return err + } + } + + for _, v := range views { + if err := v.draw(); err != nil { + return err + } + } + + Screen.Show() + return nil +} + // draw manages the cursor and calls the draw function of a view. func (g *Gui) draw(v *View) error { if g.suspended { diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go index c907c1732..e3f03d038 100644 --- a/vendor/github.com/jesseduffield/gocui/view.go +++ b/vendor/github.com/jesseduffield/gocui/view.go @@ -948,12 +948,12 @@ func (v *View) draw() error { v.writeMutex.Lock() defer v.writeMutex.Unlock() - v.clearRunes() - if !v.Visible { return nil } + v.clearRunes() + v.updateSearchPositions() maxX, maxY := v.Size() |