lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Inconsistent behavior when writing commit comments

Open jbrains opened this issue 5 years ago • 6 comments

Describe the bug The multiline comment behavior differs between the Commits > "reword commit" action and the Files > "commit" action.

With "reword commit", wrapping happens automatically, but with "commit", I need to use the TAB key to enter a newline and there is no automatic wrapping.

To Reproduce Steps to reproduce the behavior:

  1. Make a new commit with the Files > "commit" action.
  2. Type a long commit comment that goes past the right-side end of the text area. The commit comment does not wrap.
  3. Commit the changes.
  4. Choose the new commit and change its comment with the Commits > "reword commit" action.
  5. Type a long commit comment that goes past the end of the right-side end of the text area. The commit comment wraps to fit the text area and the text area extends downward.

The inconsistency in behavior between these two commands is the bug.

Expected behavior Wrapping behavior should be the same for both the "reword commit" and "commit" actions. I don't strongly recommend which action's behavior should become the standard.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Pop!_OS 20.04
  • Lazygit Version commit=, build date=2020-10-14, build source=debian, version=0.23.6, os=linux, arch=amd64

jbrains avatar Oct 16 '20 15:10 jbrains

We also discussed this as part of #28.

jbrains avatar Oct 16 '20 15:10 jbrains

Also the opt enter key command to line break the message doesn't work in "reword commit".

Amparose avatar Apr 14 '21 22:04 Amparose

Tab is the only option that works for me on Mac OS Ventura

keybinding:
  universal:
    # > ...should be able to use cmd+enter on mac: https://github.com/jesseduffield/lazygit/issues/28#issuecomment-953460275
    # note, doesn't work in reword commit: https://github.com/jesseduffield/lazygit/issues/1344
    # appendNewline: "<a-enter>" # not working for me
    appendNewline: "<tab>" # works
    # appendNewline: "<c-space>" # any keystroke enters newline

ptim avatar Feb 07 '23 14:02 ptim

The Commit window is currently under reconstruction so hopefully this issue will be resolved when it's merged :)

mark2185 avatar Feb 07 '23 14:02 mark2185

Hmm will reworking the commit window have an effect on the reword window?

tivervac avatar Mar 21 '23 15:03 tivervac

Yes, it should use the same logic.

mark2185 avatar Mar 21 '23 16:03 mark2185

I take it this is now resolved, given that the Commit window has been reworked in the latest major release?

mark2185 avatar Jul 07 '23 05:07 mark2185

This is resolved in release v0.39.0

jesseduffield avatar Jul 22 '23 04:07 jesseduffield