mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
Merge 2f0ab9489e
into 9c9b011187
This commit is contained in:
commit
d90efc0e60
2 changed files with 10 additions and 1 deletions
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
### Added
|
||||
|
||||
- `Live()`'s `visible_overflow` argument gains a new option of `"crop_above"`
|
||||
https://github.com/Textualize/rich/pull/3637
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from .segment import ControlType, Segment
|
|||
from .style import StyleType
|
||||
from .text import Text
|
||||
|
||||
VerticalOverflowMethod = Literal["crop", "ellipsis", "visible"]
|
||||
VerticalOverflowMethod = Literal["crop", "crop_above", "ellipsis", "visible"]
|
||||
|
||||
|
||||
class LiveRender:
|
||||
|
@ -86,6 +86,9 @@ class LiveRender:
|
|||
if self.vertical_overflow == "crop":
|
||||
lines = lines[: options.size.height]
|
||||
shape = Segment.get_shape(lines)
|
||||
elif self.vertical_overflow == "crop_above":
|
||||
lines = lines[-(options.size.height) :]
|
||||
shape = Segment.get_shape(lines)
|
||||
elif self.vertical_overflow == "ellipsis":
|
||||
lines = lines[: (options.size.height - 1)]
|
||||
overflow_text = Text(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue