Add word wrap option to Commit Message

Douglas Masterson 3 years ago updated by Fredrik Blomqvist 2 years ago 5

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


Any updates on this? I can't find any settings regarding it and right now, it just does soft-wrapping according to the window size. If you enable the line length guide it marks all the "too-long" lines as red. I would expect there to be a setting to set how wide the commit message can be (separate widths for the summary line and the body preferably) and then it should automatically soft-wrap to keep the text within that width. Once you hit save/commit/whatever it should automatically insert the actual line-breaks where the soft-wrapping occurred. Sounds simple enough to me.