You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I often find myself initiating a commit message with c, but then halfway through typing the message, realize that is is likely to be more substantial than I thought. I press <esc> and then C to launch my editor where I can edit a larger commit body more effectively. I finish my commit message, close my editor, return to LazyGit and all is well.
Unfortunately, the next time I press c, creating a totally new commit, my partially completed message is still present. It no longer is relevant, so I have to delete the few words I typed before.
To Reproduce
Steps to reproduce the behavior:
Set $EDITOR equal to nvim
Edit some files
Stage files
Press c
Type "Hello World"
Press <esc>
Press C
Type "Some commit message"
Press :wq to save commit message and exit
Press <enter> to return to lazygit
Edit some more files
Stage those files
Press c
See "Hello World" is still there
Expected behavior
I expect to see no preserved commit message.
Screenshots
N/A
Version info:
Building lazygit from master on 5d30409f338d1edef18054a9b3c051a5fd92a20d git version 2.25.1
Running in windows WSL2, Ubuntu
Additional context
I plan to implement this feature myself, just creating this issue for posterity.
I originally had this as a feature request, but then saw that there was code here that I believe attempts to do this exact behavior, so I changed it to a bug report.
I have just discovered that I can press <c-o> and e while in the commit panel to hop to my editor, and that version runs the above code that clears the preserved commit message. I don't know if I feel like changing my flow to use that set of keybindings, so I'm going to keep investigating the underlying fix.
But I never get this fixed, that is a valid workaround.
Describe the bug
I often find myself initiating a commit message with
c
, but then halfway through typing the message, realize that is is likely to be more substantial than I thought. I press<esc>
and thenC
to launch my editor where I can edit a larger commit body more effectively. I finish my commit message, close my editor, return to LazyGit and all is well.Unfortunately, the next time I press
c
, creating a totally new commit, my partially completed message is still present. It no longer is relevant, so I have to delete the few words I typed before.To Reproduce
Steps to reproduce the behavior:
$EDITOR
equal tonvim
c
<esc>
C
:wq
to save commit message and exit<enter>
to return to lazygitc
Expected behavior
I expect to see no preserved commit message.
Screenshots
N/A
Version info:
Building lazygit from master on
5d30409f338d1edef18054a9b3c051a5fd92a20d
git version 2.25.1
Running in windows WSL2, Ubuntu
Additional context
I plan to implement this feature myself, just creating this issue for posterity.
I originally had this as a feature request, but then saw that there was code here that I believe attempts to do this exact behavior, so I changed it to a bug report.
lazygit/pkg/gui/controllers/helpers/working_tree_helper.go
Lines 121 to 127 in 5d30409
The text was updated successfully, but these errors were encountered: