TUI: wrap long diff lines (markdown diffs get cut off)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
Research direction
Start with crates/but/src/command/legacy/status/tui/details.rs and trace how DetailsLine::Code rows are rendered and counted against the details pane width. Compare that with the existing TextToWrap handling and the GUI’s diff::ToggleWrap behavior. Done when long diff lines can wrap to the available terminal or pane width in the TUI, with a toggle or setting to control wrapping.
Written by the indexing model from the issue text.
Description
I've been using but tui on this device, and one of the issues I'm having is that on markdown files the diffs don't get wrapped. Long lines just get cut off at the edge of the details pane, so for markdown (where a whole paragraph is one line) you basically can't read the change unless you open the GUI.
The GUI has the ability to (soft)wrap text (alt-z / diff::ToggleWrap), so it would be great to have the same thing in the TUI.
what I'd like
- a way to wrap diff lines based on the terminal / pane width
- either a keybinding toggle like the GUI, or a setting (
but config ...or an env var likeBUT_THEME) so it can be on by default
what I checked
but tui --helpandbut configdon't have any wrap option- the TUI docs (https://docs.gitbutler.com/gitbutler-tui) don't mention wrapping
- looking at the source,
crates/but/src/command/legacy/status/tui/details.rsonly wrapsTextToWrap(commit messages).DetailsLine::Codelines are rendered into a single row and always counted as 1 line, so anything past the width gets clipped
workarounds right now
but diff --no-tui(terminal wraps it)git diff --word-diff
both work but you lose the TUI flow, so a toggle in the TUI would be really nice.
version
but 0.23.2 on macOS
- Dominant language
- Rust
- Stars
- 21.9k
- Forks
- 1k
- Avg merge
- 6h 1m
- Merged PRs (30d)
- 657
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gitbutlerapp/gitbutler
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gitbutlerapp/gitbutler#16982 ·
Maintainers usually reply within 1 day
-
Gitlab is not on the list of allowed img-srcPossibly taken @masecla22 claimed this 46 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 2 comments ·
Maintainers usually reply within 1 day
-
copy branch name buttonPossibly taken @masecla22 claimed this 39 days ago. Openenhancement UI (Svelte)
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
gitbutlerapp/gitbutler#15709 · 2 comments ·
Maintainers usually reply within 1 day
-
documentation enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#14406 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
gitbutlerapp/gitbutler#17057 ·
Maintainers usually reply within 1 day
All issues in gitbutlerapp/gitbutler
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rubys/roundhouse#1917 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pop-os/cosmic-applets#1619 ·
Maintainers usually reply within 3 days
-
binding:python bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day