commitizen-tools / commitizen

Create committing rules for projects :rocket: auto bump versions :arrow_up: and auto changelog generation :open_file_folder:
https://commitizen-tools.github.io/commitizen/
MIT License
2.37k stars 257 forks source link

How to type multiple lines for body part? #6

Closed WqyJh closed 4 years ago

WqyJh commented 5 years ago

I was trying to type multiple lines for body part, but when I type the Enter key it moved to footer part, which means that I could only type one line for body part. So I was wondering how to change lines when typing for the body part.

woile commented 5 years ago

hey there's no current support for this unfortunately. I will implement something to not escape the new line symbol. It'll be possible to do My body \n is great.

Eventually I'll try to migrate to the new python-prompt-toolkit 2.0.0 and we'll see if it possible to use something like shift + Enter.

Meanwhile you can modify the body with git commit --amend

WqyJh commented 5 years ago

Well, thank you for reply. I think git commit --amend is a good way of doing this.

televi commented 5 years ago

Have you considered switching from whaaat to PyInquirer? In addition to supporting the latest versions of the prompt-toolkit, it support the editor type so that users can enter multiple lines of text via their favorite editor. I can git that a shot if you'd like an submit a pull request if I get it working. The developer for whaaat seems to have no time at present to maintain that project while PyInquirer is still active (https://github.com/CITGuru/PyInquirer).

woile commented 5 years ago

I'm moving to questionary. It had support for prompt toolkit 2 and is maintained.

https://github.com/tmbo/questionary

Wil check if it's possible to multi line.

Edit: pr here https://github.com/Woile/commitizen/pull/9

Lee-W commented 4 years ago

As I tested, it seems commitizen doesn't support multiple line input yet.

After reading python-prompt-toolkit::multiline-input, it does not seem to be a good solution to me.

How about implement it like cz-cli?

Provide a LONGER description of the change (optional). Use "|" to break new line:

woile commented 4 years ago

Seems like a valid option. I'd give it a try, it may not be the best, but it's something to start with