gitui
gitui copied to clipboard
Allow multiline commit messgages
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
Just realized I still have to deal with non-ascii characters so I'm changing this to draft.
@heiskane thanks for tackling this!
@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.
Yeah the multibyte chars need to work though :)
@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.
can you rebase and fix the merge conflicts please?
@extrawurst Done :+1:

probably best to squash yourself to figure out what's the problem here
@extrawurst Okay now i think its all correct. ps. I was just being i bit dumb lol
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:
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:

please squash all your changes together and rebase on top of current master
Squashed
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 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 👍
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?
Sure that works for me 👍
superceded by #1963