Skip to content

Conversation

@stefanhaller
Copy link
Collaborator

When showing a confirmation whose text ends with a line feed, we would make the popup panel one line less tall than it needs to be, so it would show a scroll bar. One example where this occurred is the very first popup that users ever see (the "seriously you rock" message for new users); that's a pretty bad first impression.

This happens because our code to suppress trailing newlines in views doesn't work for styled text, and the text in confirmations is bold. This code checks if the last character of the text is a line feed, and in this case it isn't; the escape sequence for turning bold off comes after it.

We should really fix this by improving that mechanism, but this would require some tricky logic, so as a quick fix, trim trailing (and leading) linefeeds from the text that we display in a confirmation, before making it bold.

This is identical to the one right before.
When showing a confirmation whose text ended with a line feed, we would make the
popup panel one line less tall than it needs to be, so it would show a scroll
bar. One example where this occurred is the very first popup that users ever see
(the "seriously you rock" message for new users); that's a pretty bad first
impression.

This happens because our code to suppress trailing newlines in views doesn't
work for styled text, and the text in confirmations is bold. This code checks if
the last character of the text is a line feed, and in this case it isn't; the
escape sequence for turning bold off comes after it.

We should really fix this by improving that mechanism, but this would require
some tricky logic, so as a quick fix, trim trailing (and leading) linefeeds from
the text that we display in a confirmation, before making it bold.
@stefanhaller stefanhaller added the bug Something isn't working label Aug 8, 2025
@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for c0dcf7d1 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c0dcf7d) Report Missing Report Missing Report Missing
Head commit (09e2bfa) 57213 49730 86.92%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4804) 1 1 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@stefanhaller stefanhaller merged commit 26db25b into master Aug 9, 2025
13 checks passed
@stefanhaller stefanhaller deleted the fix-popup-output branch August 9, 2025 09:52
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 12, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | patch | `v0.54.1` -> `v0.54.2` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary>

### [`v0.54.2`](https://github.com/jesseduffield/lazygit/releases/tag/v0.54.2)

[Compare Source](jesseduffield/lazygit@v0.54.1...v0.54.2)

<!-- Release notes generated using configuration in .github/release.yml at v0.54.2 -->

Here's another point release; this one fixes a performance regression in 0.54.0 that made flicking through diffs a little less snappy (or a lot less, in some scenarios) than it could be.

For the changes in 0.54.0, see https://github.com/jesseduffield/lazygit/releases/tag/v0.54.0.

#### What's Changed

##### Fixes 🔧

- Fix scrollbar in certain popup panels (e.g. the intro message for new users) by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4804
- Fix delay with flicking through files or commits when git diff is very slow by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4803

##### Maintenance ⚙️

- Stop bumping our homebrew formula by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4799
- Update the badges of golangci-lint and homebrew in `README.md` by [@&#8203;kyu08](https://github.com/kyu08) in jesseduffield/lazygit#4807

##### Docs 📖

- Fix the useHunkModeInStagingView hint in the breaking changes message by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4800
- Update `CONTRIBUTING.md` to clarify translation contribution process by [@&#8203;kyu08](https://github.com/kyu08) in jesseduffield/lazygit#4806

**Full Changelog**: jesseduffield/lazygit@v0.54.1...v0.54.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42MS4xIiwidXBkYXRlZEluVmVyIjoiNDEuNjEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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 this pull request may close these issues.

2 participants