Skip to content

Default arguments for clip(start=0, end=-1) - #250

Merged
jquast merged 1 commit into
masterfrom
clip-end-default
Sep 15, 2026
Merged

jquast merged 1 commit into
masterfrom
clip-end-default

Conversation

@jquast

@jquast jquast commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

clip() arguments start and end are now optional, default end=-1 clips from start through the final column without requiring the caller to measure the display width of the remaining text.

Any other negative end value raises ValueError.

Closes #242. Suggested by @Klox in jquast/blessed#402

clip() arguments start and end are now optional, default end=-1 clips
from start through the final column without requiring the caller to
measure the display width of the remaining text.

Any other negative end raises ValueError.

Closes #242. Suggested by @Klox in jquast/blessed#402
@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d11cbea) to head (c6248d9).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #250   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         1999      2004    +5     
  Branches       467       469    +2     
=========================================
+ Hits          1999      2004    +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 108 untouched benchmarks
🆕 8 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_clip_ascii_to_end N/A 20.8 µs N/A
🆕 test_clip_cursor_cr_to_end N/A 1.8 ms N/A
🆕 test_clip_dense_ansi_to_end N/A 9.2 ms N/A
🆕 test_clip_dense_ansi_to_end_no_propagate N/A 6.9 ms N/A
🆕 test_clip_japanese_to_end N/A 102.6 µs N/A
🆕 test_clip_long_ascii_to_end N/A 163.7 µs N/A
🆕 test_clip_long_cjk_to_end N/A 7.7 ms N/A
🆕 test_clip_osc8_hyperlinks_to_end N/A 829.8 µs N/A

Comparing clip-end-default (c6248d9) with master (d11cbea)

Open in CodSpeed

@jquast
jquast merged commit f7b9df5 into master Sep 15, 2026
35 checks passed
@jquast
jquast deleted the clip-end-default branch September 15, 2026 19:52
jquast added a commit that referenced this pull request Sep 15, 2026
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.

wcwidth.clip could accept end=-1

1 participant