Repository navigation
fix: render tabs in commit messages as spaces - #3039
Open
costajohnt wants to merge 1 commit into
Open
costajohnt wants to merge 1 commit into
costajohnt wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request fixes/closes #3036.
On v0.28.1 a tab in a commit message reaches the terminal, moves the cursor to the next tab stop, and ratatui loses track of what's on screen, so the commit list row comes out scrambled and old text is left behind. On current master ratatui 0.30 strips the control character instead, so
PR:\t123shows asPR:123. This converts tabs to spaces with the existingstring_utils::tabs_to_spaces, the same way the diff and blame views already do.It changes the following:
wrap_commit_details), with a unit testLogEntry::from), which covers the revlog, stash list and file historyChecked with a scratch repo committed with
$'subj\twith tab\n\nPR:\t299119', opened in a 120x30 terminal:subjubj witabsubj with tab/PR: 299119subjwith tabsubjwith tab/PR:299119subj with tabsubj with tab/PR: 299119I followed the checklist:
make checkwithout errors (ran its steps individually:cargo fmt -- --check,cargo clippy --workspace --all-features,cargo test --workspace(320 passed) andcargo deny checkare clean; I don't have cargo-nextest or cargo-sort installed, and no Cargo.toml changed)