Skip to content

Conversation

@axsaucedo
Copy link

feat: Adds min-width parameter to enable toggling of side-by-side based on terminal width

This PR includes:

  • Adding the side_by_side_min_width option with default=0
  • Adding a few tests that validate the min_size applies accordingly (incl git config)
  • Extended terminal width param to support TERMINAL_WIDTH_IN_TESTS

Usage tested in CLI:

git diff | /delta/target/debug/delta --side-by-side --side-by-side-min-width

Usage tested in git config:

[core]
    pager = /delta/target/debug/delta

[delta]
    side-by-side = true
    side-by-side-min-width = 140

As well as:

[core]
    pager = /delta/target/debug/delta --side-by-side --side-by-side-min-width

Functionality is as follows with term_width < min_width:

image

And with min_width < term_width:

image

Fixes #2083

side-by-side feature based on the terminal width. By default it's 0 (ie
disabled).

Fixes dandavison#2083
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.

🚀 feat: side-by-side support toggle based on terminal width

1 participant