[PR #373] [MERGED] Allow alternative area explicit sizing in splits #366

Closed
opened 2026-03-03 16:24:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mum4k/termdash/pull/373
Author: @spacez320
Created: 3/5/2024
Status: Merged
Merged: 3/10/2024
Merged by: @mum4k

Base: develHead: 292-allow-splitfixed-to-set-the-size-of-the-second-container


📝 Commits (10+)

  • bc63a16 Merge pull request #370 from mum4k/release_v0_19_0
  • 4465700 Allow reverse horizontal area splits
  • 275c62f Restore HSplitCells to original function signature
  • 610a070 Add test for HSplitCellsReversed
  • ca93ed8 Define shared logic for vertical cell splits
  • 992d7f3 Lint fixes
  • 5b66484 Reversed split for percentages
  • 029ce61 Linting adjustments
  • edab304 Function re-ordering
  • ec14443 More documentation updates

📊 Changes

5 files changed (+651 additions, -35 deletions)

View changed files

📝 container/container.go (+12 -0)
📝 container/container_test.go (+105 -1)
📝 container/options.go (+57 -10)
📝 private/area/area.go (+142 -24)
📝 private/area/area_test.go (+335 -0)

📄 Description

This change allows one to apply split options that affect the size of either area elements in a split, whereas previously only the first area element could be explicitly sized.

Users can accomplish this by providing SplitFixedFromEnd or SpltPercentFromEnd options to containers, mirroring the existing SplitFixed and SplitPercent.

A list of changes involved in this PR include:

  • Adding a new boolean container option splitReversed to indicate when the alternative area should be targeted with an explicit size. By default, this is false, retaining existing behavior.
  • Adds public container option functions SplitFixedFromEnd and SplitPercentFromEnd.
  • For fixed split math, adds private module functions HSplitReversed and VSplitReversed to mirror HSplit and VSplit. Common logic for these functions is isolated to private hSplit and vSplit functions used respectively. Added similar functions for percentage variants.
  • Added tests.
  • Fixed some test and documentation verbiage.

Fixes https://github.com/mum4k/termdash/issues/292


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mum4k/termdash/pull/373 **Author:** [@spacez320](https://github.com/spacez320) **Created:** 3/5/2024 **Status:** ✅ Merged **Merged:** 3/10/2024 **Merged by:** [@mum4k](https://github.com/mum4k) **Base:** `devel` ← **Head:** `292-allow-splitfixed-to-set-the-size-of-the-second-container` --- ### 📝 Commits (10+) - [`bc63a16`](https://github.com/mum4k/termdash/commit/bc63a16bf84160f6f4ce4dc72542937b560fb853) Merge pull request #370 from mum4k/release_v0_19_0 - [`4465700`](https://github.com/mum4k/termdash/commit/4465700c5dbbbe9a0dd2c45ead0e06973fccf42e) Allow reverse horizontal area splits - [`275c62f`](https://github.com/mum4k/termdash/commit/275c62fc47cbe1b997ffc6b3a70ece29998434d7) Restore HSplitCells to original function signature - [`610a070`](https://github.com/mum4k/termdash/commit/610a070aab7ab83ffbce53879be3eb4e58c664d0) Add test for HSplitCellsReversed - [`ca93ed8`](https://github.com/mum4k/termdash/commit/ca93ed8334d533822f6df78f6728b6826d9af161) Define shared logic for vertical cell splits - [`992d7f3`](https://github.com/mum4k/termdash/commit/992d7f3bfcea164bf38d808871462b9e8d509fa9) Lint fixes - [`5b66484`](https://github.com/mum4k/termdash/commit/5b664845a5896d26453cc74ce54b2768ea869a08) Reversed split for percentages - [`029ce61`](https://github.com/mum4k/termdash/commit/029ce611e8e34d0bce11b652b86a30b7e41e1b86) Linting adjustments - [`edab304`](https://github.com/mum4k/termdash/commit/edab304013374a1168c0d4e35d996997b5e49fb4) Function re-ordering - [`ec14443`](https://github.com/mum4k/termdash/commit/ec14443ef984b765491e70ef45c22a0655c7b3fb) More documentation updates ### 📊 Changes **5 files changed** (+651 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `container/container.go` (+12 -0) 📝 `container/container_test.go` (+105 -1) 📝 `container/options.go` (+57 -10) 📝 `private/area/area.go` (+142 -24) 📝 `private/area/area_test.go` (+335 -0) </details> ### 📄 Description This change allows one to apply split options that affect the size of either area elements in a split, whereas previously only the first area element could be explicitly sized. Users can accomplish this by providing `SplitFixedFromEnd` or `SpltPercentFromEnd` options to containers, mirroring the existing `SplitFixed` and `SplitPercent`. A list of changes involved in this PR include: - Adding a new boolean container option `splitReversed` to indicate when the alternative area should be targeted with an explicit size. By default, this is `false`, retaining existing behavior. - Adds public container option functions `SplitFixedFromEnd` and `SplitPercentFromEnd`. - For fixed split math, adds private module functions `HSplitReversed` and `VSplitReversed` to mirror `HSplit` and `VSplit`. Common logic for these functions is isolated to private `hSplit` and `vSplit` functions used respectively. Added similar functions for percentage variants. - Added tests. - Fixed some test and documentation verbiage. Fixes https://github.com/mum4k/termdash/issues/292 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:24:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#366
No description provided.