Support right-side sidebar decorations - #3985
Open
Matei02355 wants to merge 2 commits into
Open
Conversation
Matei02355
marked this pull request as ready for review
September 7, 2026 16:05
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.
Add the opt-in
sidebar-rightstyle modifier to move the selected line numbers, Git markers and grid to the right of the content. For example,--style=default,sidebar-rightuses the usual decorations on the right;--style=+sidebar-rightpreserves the configured decoration selection. Library callers can usePrettyPrinter::sidebar_right().Render the sidebar after each physical row, padding shorter rows to the available width. Continuation rows leave the number and Git marker blank. Mirror header/footer grid junctions and align headers and snip separators with the relocated grid. Number/plain shortcuts retain the placement modifier without enabling other decorations. Defaults keep the existing left-side layout.
With wrapping disabled, overlong content keeps its complete text and appends the sidebar after it. Moving decorations does not remove them from a multiline terminal selection; the README explains using plain output for that use case. Help, manual and four shell completions are updated.
Fixes #2245.
Validation: 481 tests passed with all features, including eight new process/library regressions; seven platform/manual tests were ignored. Coverage includes character/word/no wrapping, wide Unicode, CRLF and missing final newlines, tabs, nonblank numbering, ANSI colors and highlighted backgrounds, narrow terminals, headers, snips, Git changes, plain output and resetting the library option. All-target/all-feature Clippy, formatting, Bash/Zsh parsing and the minimal regex-onig library build passed.