Skip to content

Support right-side sidebar decorations - #3985

Open
Matei02355 wants to merge 2 commits into
sharkdp:masterfrom
Matei02355:right-sidebar-2245-20260907
Open

Support right-side sidebar decorations#3985
Matei02355 wants to merge 2 commits into
sharkdp:masterfrom
Matei02355:right-sidebar-2245-20260907

Conversation

@Matei02355

Copy link
Copy Markdown
Contributor

Add the opt-in sidebar-right style modifier to move the selected line numbers, Git markers and grid to the right of the content. For example, --style=default,sidebar-right uses the usual decorations on the right; --style=+sidebar-right preserves the configured decoration selection. Library callers can use PrettyPrinter::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.

@Matei02355
Matei02355 marked this pull request as ready for review September 7, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shift sidebar to right

1 participant