commitlint icon indicating copy to clipboard operation
commitlint copied to clipboard

prompt: how to add newlines to body

Open Tapppi opened this issue 8 years ago • 4 comments

There seems to be no way of adding newlines to the body of the commit. No way to really use for long commit messages as is, since a one line huge body isn't that nice.

Expected Behavior

Shift+enter or \n should work.

Even better would be auto wrapping to say 80 characters, so that one could write it out naturally, but the prompt would cut it down to lines.

Current Behavior

Enter (and shift+enter) submits and \n gets printed as is 😢

Affected packages

  • [ ] cli
  • [ ] core
  • [x] prompt
  • [ ] config-angular

Tapppi avatar Feb 06 '18 16:02 Tapppi

Yep, currently @commitlint/prompt does not support multiline input.

The thing with multiline editing is that it is very hard to scope this properly - when thinking things through you reach the feature set of a general purpose text editor.

That being said I guess we could come up with some scheme to allow for multiline output on a single line input (as your suggestions imply).

Personally I held back with changes on @commitlint/prompt due to #86

marionebl avatar Feb 15 '18 19:02 marionebl

@marionebl Shouldn't auto-wrapping on spaces work with vorpal?

Edit: Sorry just read your comment more carefully. You already said that \n or other forms of doing it on single line should work.

fahrradflucht avatar Mar 11 '18 09:03 fahrradflucht

Here I have an interest in this. Any update?

jjangga0214 avatar Aug 06 '21 09:08 jjangga0214

So should I, for now, disable the "body-leading-blank" property in my config ?

raul1991 avatar May 04 '22 06:05 raul1991