Add word wrap option to Commit Message

Douglas Masterson 3 months ago • updated by Jordan Miner 3 weeks ago 4

I often find myself having to add text to the middle of my commit message, and I thus have to change all of the following lines so that they adhere to the line length guidelines. It would be nice if the Commit Message editor would word wrap at line length guide.

And correctly indent the second and subsequent lines for bulleted lists (e.g. lines that begin with * or -).  e.g.:

* This is my list that wraps

  onto multiple lines with a

  formatted paragraph and indent.

Do I understand this request correctly: It should enable work-wrap in the control but upon clicking the Commit button, it should insert line-endings automatically for too-long lines?

That works for me.

The key thing is auto-formatting to the correct length while typing, whether it uses hard newlines or not in the control, and then submits with hard newlines as formatted.

I would really like this feature, but I think I would prefer it to be a separate command before committing so that I could see the result. I would prefer it to rewrap any selected lines, and if you run the command with nothing selected, it would rewrap the paragraph the caret is in (removing and inserting line-endings to wrap the text). I use the Rewrap extension for Visual Studio Code to wrap comments, and that's the behavior it has: https://marketplace.visualstudio.com/items?itemName=stkb.rewrap