gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Allow multiline commit messgages

Open heiskane opened this issue 2 years ago • 5 comments

This Pull Request fixes/closes #1171

It changes the following:

  • Allow using enter to create a newline in commit message box
  • Up/Down arrow changes the line the cursor is on
  • Keybind to confirm commit message had to be changed to ctrl + s
  • Works with multibyte/special characters
  • Fixes incorrect character count shown in commit message box when multibyte characters are used

I followed the checklist:

  • [x] I added unittests
  • [x] I ran make check without errors
  • [x] I tested the overall application
  • [x] I added an appropriate item to the changelog

heiskane avatar Sep 14 '22 19:09 heiskane

Just realized I still have to deal with non-ascii characters so I'm changing this to draft.

heiskane avatar Sep 14 '22 20:09 heiskane

@heiskane thanks for tackling this!

extrawurst avatar Sep 18 '22 10:09 extrawurst

@extrawurst No problem although i am having some trouble with non-ascii characters. To clarify the multiline commit messages are in fact working already but the issues with the special characters happen when trying to use up and down arrows to move cursor up/down.

heiskane avatar Sep 25 '22 12:09 heiskane

Yeah the multibyte chars need to work though :)

extrawurst avatar Sep 25 '22 15:09 extrawurst

@extrawurst I'm still pretty new to contributing on GitHub and not sure if you get pinged when i switch my pull request back to open so pinging just to be sure.

heiskane avatar Oct 02 '22 19:10 heiskane

can you rebase and fix the merge conflicts please?

extrawurst avatar Oct 20 '22 14:10 extrawurst

@extrawurst Done :+1:

heiskane avatar Oct 20 '22 14:10 heiskane

Screenshot 2022-10-20 at 16 43 43

probably best to squash yourself to figure out what's the problem here

extrawurst avatar Oct 20 '22 14:10 extrawurst

@extrawurst Okay now i think its all correct. ps. I was just being i bit dumb lol

heiskane avatar Oct 20 '22 15:10 heiskane

Just realized that the existing MultiLine input type does not really mean what i thought it means so this does actually break the input boxes in other places. Not sure how i didnt notice but either way I'm changing this back to draft and ill try to fix it asap :+1:

heiskane avatar Oct 22 '22 12:10 heiskane

Sorry for almost messing up there :grimacing:. I thought that the MultiLine type indicated that multiline messages are allowed but that wasn't quite it. I have changed other input boxes correctly to SingleLine and increased the singleline input box to make sure that stuff like longer branch names will fit into it (62 characters should be enough to fit right?). Maybe singleline input box could grow in size as needed in the future? I double checked that all input boxes are worked as they should and re-ran tests.

Also seems like i have a thing or two to learn about rebasing but as far as i can tell it should be all good to merge :+1:

heiskane avatar Oct 22 '22 13:10 heiskane

Screenshot 2022-10-24 at 16 36 27

please squash all your changes together and rebase on top of current master

extrawurst avatar Oct 24 '22 14:10 extrawurst

Squashed

heiskane avatar Oct 24 '22 16:10 heiskane

I tested it again and it does not keep the cursor in view aka it is not scrolling to the line we are editing it only ever keeps the first x lines visible.

let me know in case you cannot reproduce this - you just need to press enter a few times.

putting it in draft till fixed

extrawurst avatar Oct 26 '22 12:10 extrawurst

I tested it again and it does not keep the cursor in view aka it is not scrolling to the line we are editing it only ever keeps the first x lines visible.

let me know in case you cannot reproduce this - you just need to press enter a few times.

putting it in draft till fixed

I just haven't implemented the scroll yet. I kinda felt like that would be worth another issue but I'll try add it to this PR when I have time 👍

heiskane avatar Oct 26 '22 12:10 heiskane

you are right that it is worth doing a separate smaller PR for. but lets reverse the order and have that separate PR first, because as it is right now the scrolling would already be useful to have in the current state of gitui. can you create a separate PR for that based on current master? this way we do not blow this one up more and still get a nice value added once the first (hopefully smaller) PR is merged. wdyt?

extrawurst avatar Oct 26 '22 12:10 extrawurst

Sure that works for me 👍

heiskane avatar Oct 26 '22 13:10 heiskane

superceded by #1963

extrawurst avatar Feb 12 '24 10:02 extrawurst