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

Confirmation view is sometimes not tall enough to fit content #2872

Closed
jesseduffield opened this issue Aug 3, 2023 · 0 comments · Fixed by #2879
Closed

Confirmation view is sometimes not tall enough to fit content #2872

jesseduffield opened this issue Aug 3, 2023 · 0 comments · Fixed by #2879
Labels
bug Something isn't working

Comments

@jesseduffield
Copy link
Owner

Describe the bug

Some messages aren't contained in their entirety inside the confirmation view.

This is a tricky one: we recently improved the word wrap behaviour in gocui, our underlying library: #2812.

But we have a function (

func getMessageHeight(wrap bool, message string, width int) int {
) in lazygit for determining the height of a confirmation message, and this function assumes the old behaviour of gocui. As such it thinks the message can fit within a tighter space than it actually can.

Some potential solutions:

  • export the wrap logic from gocui so it can be used from lazygit
  • add a field to gocui.View allowing it to extend its height to fit the content (up to a limit). This would require us centering the view properly back in the lazygit side
  • something I haven't thought of yet

To Reproduce
In a small window, drop a commit, then press 'z' to undo and observe that the confirmation message
is not fully contained within the view.

Expected behavior
The confirmation view is taller to fit the message in its entirety

Screenshots
image

Version info:
commit=c390c9d58edc18083ed7f1a672b03b7c4d982c12, build date=2023-08-03T08:22:30Z, build source=unknown, version=c390c9d5, os=darwin, arch=amd64, git version=2.41.0

@jesseduffield jesseduffield added the bug Something isn't working label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant