summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui_driver.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-07-31 18:32:38 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-07-31 22:33:04 +1000
commit9cc1d6528068d6552fd72461a2ad49987edd39da (patch)
tree9aeaf86ce1fa3d2bb5fc19c227042c78fbd5f2a0 /pkg/gui/gui_driver.go
parent71d2fd37e2ff8214d5af3135ab3a355971789dc2 (diff)
Add demo test variant
We're piggybacking on our existing integration test framework to record demos that we can include in our docs
Diffstat (limited to 'pkg/gui/gui_driver.go')
-rw-r--r--pkg/gui/gui_driver.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/pkg/gui/gui_driver.go b/pkg/gui/gui_driver.go
index 630da5b0b..8bab6218d 100644
--- a/pkg/gui/gui_driver.go
+++ b/pkg/gui/gui_driver.go
@@ -42,7 +42,11 @@ func (self *GuiDriver) PressKey(keyStr string) {
0,
)
- // wait until lazygit is idle (i.e. all processing is done) before continuing
+ self.waitTillIdle()
+}
+
+// wait until lazygit is idle (i.e. all processing is done) before continuing
+func (self *GuiDriver) waitTillIdle() {
<-self.isIdleChan
}
@@ -111,3 +115,13 @@ func (self *GuiDriver) View(viewName string) *gocui.View {
}
return view
}
+
+func (self *GuiDriver) SetCaption(caption string) {
+ self.gui.setCaption(caption)
+ self.waitTillIdle()
+}
+
+func (self *GuiDriver) SetCaptionPrefix(prefix string) {
+ self.gui.setCaptionPrefix(prefix)
+ self.waitTillIdle()
+}