Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to view large commit messages in log #181

Closed
werman opened this issue Jul 7, 2020 · 7 comments
Closed

Ability to view large commit messages in log #181

werman opened this issue Jul 7, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@werman
Copy link

werman commented Jul 7, 2020

Is your feature request related to a problem? Please describe.

I'm dealing with git repositories which have large commit messages, e.g. https://gitlab.freedesktop.org/mesa/mesa/-/commit/797fa87ec9891384fee7588fda36c80dfed1a39d, no matter how big I make the tui - commit message would not be fully visible.

Describe the solution you'd like
Describe alternatives you've considered

Two solutions comes to mind:

  • Be able to focus "Message" window and scroll it with arrows
  • Have a hotkey to open the message "full-screen" with arrows scrolling
@extrawurst
Copy link
Owner

@werman thanks for your interest in gitui. that actually makes sense, sometimes found myself scaling the terminal font to be able to read big-ass messages that are used in some repos 🙈

@extrawurst extrawurst added the enhancement New feature or request label Jul 7, 2020
@extrawurst extrawurst added this to the v0.9 milestone Jul 9, 2020
@cruessler
Copy link
Contributor

@extrawurst If this is not yet taken, I’d give it a try! Do you have a specific solution in mind?

@extrawurst
Copy link
Owner

@cruessler nice! Feel free to take it but I think this one is actually more involved, because I think the best solution is to allow switching focus between the message and the file tree (when in the fullscreen commit-detail view only) via arrow-up and down.
this is the preferred solution to having a dedicated new hotkey to switch to the message.

once the message is focused arrow-up/down scrolls it.

so the problem with that solution is that we need to know when the bottom of the message is reached and a next arrow-down will switch focus again back down to the filetree. the paragraph drawing in tui-rs only takes a scroll as integer and for the message drawing we use is doing the word-wrap internally without a channel back to us to know how many lines there are to scroll.

There is some investigation needed, maybe tui-rs stateful-drawing presents a solution or the line-wrapping part can be exposed to access it or (most involved) we need to implement our own line-wrapped-drawing of the message.

But of course I might be missing something and there is an elegant solution here that I am missing :)

@extrawurst
Copy link
Owner

Here is a open ticket basically about the lack such a feature in tui-rs: fdehau/tui-rs#89

But the last commenter basically provides a solution feasible for us: using textwrap crate to manually do the word wrapping and draw it using non-wrap paragraph. This way we know the number of lines upfront and know the bounds for the scrolling.

See https://github.com/mgeisler/textwrap (but no fancy hyphenation feature please)

Soo @cruessler wanna go for it?

@extrawurst
Copy link
Owner

@cruessler hey man anything I can help you with here to get this out the door?

@cruessler
Copy link
Contributor

@extrawurst Thanks for asking! I was busy preparing a talk, but since that's done now, I want to finish the PR this weekend. I'll let you know if I run into trouble!

@cruessler
Copy link
Contributor

@extrawurst A good chunk of the work is done. I expect to be able to update the PR in the next few days.

@extrawurst extrawurst removed this from the v0.9 milestone Jul 29, 2020
cruessler added a commit to cruessler/gitui that referenced this issue Jul 30, 2020
- Manually wrap commit message using `textwrap`

Closes extrawurst#181
cruessler added a commit to cruessler/gitui that referenced this issue Aug 3, 2020
- Manually wrap commit message using `textwrap`

Closes extrawurst#181
cruessler added a commit to cruessler/gitui that referenced this issue Aug 4, 2020
- Manually wrap commit message using `textwrap`

Closes extrawurst#181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants