summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/helpers/inline_status_helper.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2024-03-23 20:48:54 +1100
committerGitHub <noreply@github.com>2024-03-23 20:48:54 +1100
commit1337a943fe06c58e4f7783ddad4c2d7f91d43054 (patch)
tree12c47d72bc136cf1a4954865478ad683966eeefe /pkg/gui/controllers/helpers/inline_status_helper.go
parent3675570a391b1a49ddd198b4c7e71e17701d4404 (diff)
parent471ea397582775476d5636c6c5179b89e411e4e9 (diff)
Update interactive rebase demo (#3392)
**PR Description** This is in anticipation of the new release which supports range-select. - **Please check if the PR fulfills these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [x] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [x] Docs (specifically `docs/Config.md`) have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
Diffstat (limited to 'pkg/gui/controllers/helpers/inline_status_helper.go')
-rw-r--r--pkg/gui/controllers/helpers/inline_status_helper.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/pkg/gui/controllers/helpers/inline_status_helper.go b/pkg/gui/controllers/helpers/inline_status_helper.go
index 2476a57cf..7bc8cb456 100644
--- a/pkg/gui/controllers/helpers/inline_status_helper.go
+++ b/pkg/gui/controllers/helpers/inline_status_helper.go
@@ -131,12 +131,28 @@ func (self *InlineStatusHelper) stop(opts InlineStatusOpts) {
info.stop <- struct{}{}
delete(self.contextsWithInlineStatus, opts.ContextKey)
}
-
}
self.mutex.Unlock()
self.c.State().ClearItemOperation(opts.Item)
+
+ // When recording a demo we need to re-render the context again here to
+ // remove the inline status. In normal usage we don't want to do this
+ // because in the case of pushing a branch this would first reveal the ↑3↓7
+ // status from before the push for a brief moment, to be replaced by a green
+ // checkmark a moment later when the async refresh is done. This looks
+ // jarring, so normally we rely on the async refresh to redraw with the
+ // status removed. (In some rare cases, where there's no refresh at all, we
+ // need to redraw manually in the controller; see TagsController.push() for
+ // an example.)
+ //
+ // In demos, however, we turn all async refreshes into sync ones, because
+ // this looks better in demos. In this case the refresh happens while the
+ // status is still set, so we need to render again after removing it.
+ if self.c.InDemo() {
+ self.renderContext(opts.ContextKey)
+ }
}
func (self *InlineStatusHelper) renderContext(contextKey types.ContextKey) {