Clear preserved commit message when entering CommitEditorPanel #4558
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pretty basic implementation of this fix. The one thing I considered doing that I didn't was to rename
OnCommitSuccess
, since now 2 out of 4 call sites invoke it prior to make the commit message (and one does it here to invoke a tag, which might be a separate bug)lazygit/pkg/gui/controllers/helpers/tags_helper.go
Lines 36 to 39 in 5d30409
The implementation of
OnCommitSuccess
also leaves me a bit confused. I'm not sure why it doesn't clear the message every time. By checking with theCommitMessageViewModel.preserveMessage
, we only open up the option that we don't clear an existing message should that befalse
. Is there some world where this is desired? I figure if they are opening the window without the intent to save the message, it would be even more okay to throw away any potential message stored there.lazygit/pkg/gui/controllers/helpers/commits_helper.go
Lines 160 to 165 in 5d30409
Fixes #4557
go generate ./...
)