Skip to content

Improve width() and clip() with kitty Text Sizing Protocol#213

Merged
jquast merged 6 commits into
masterfrom
jq/text-sizing-protocol
May 2, 2026
Merged

Improve width() and clip() with kitty Text Sizing Protocol#213
jquast merged 6 commits into
masterfrom
jq/text-sizing-protocol

Conversation

@jquast
Copy link
Copy Markdown
Owner

@jquast jquast commented Apr 8, 2026

Example WIP in downstream blessed project tested successfully, used TextSizing() to construct varying fractional sizes, and clip() to select a visible range (screen width),

https://www.jeffquast.com/kitty-text-sizing.mp4

kitty-text-sizing-.2.mp4

Comment thread wcwidth/osc66.py Fixed
Comment thread wcwidth/osc66.py Fixed
Comment thread wcwidth/wcwidth.py Fixed
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 8, 2026

Merging this PR will not alter performance

✅ 86 untouched benchmarks
🆕 2 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_clip_osc66 N/A 195.6 µs N/A
🆕 test_width_osc66 N/A 96.4 µs N/A

Comparing jq/text-sizing-protocol (1511cc5) with master (e5a5f66)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (28a39d9) to head (1511cc5).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master      #213    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           15        23     +8     
  Lines         1030      1525   +495     
  Branches       263       365   +102     
==========================================
+ Hits          1030      1525   +495     

☔ View full report in Codecov by Sentry.
📢 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.

Comment thread wcwidth/text_sizing.py Fixed
Comment thread wcwidth/wcwidth.py Fixed
Comment thread wcwidth/_constants.py Fixed
Comment thread wcwidth/_constants.py Fixed
Comment thread wcwidth/_constants.py Fixed
Comment thread wcwidth/_constants.py Fixed
Comment thread wcwidth/_constants.py Fixed
Comment thread wcwidth/_constants.py Fixed
Comment thread wcwidth/_constants.py Fixed
Comment thread wcwidth/wcwidth.py Fixed
@jquast jquast changed the title Text Sizing Protocol (WIP/DRAFT!) Text Sizing Protocol with refactor Apr 27, 2026
Comment thread tests/test_text_sizing.py Fixed
Comment thread tests/test_text_sizing.py Fixed
@jquast jquast changed the title Text Sizing Protocol with refactor Text Sizing Protocol [DRAFT]\ Apr 30, 2026
@jquast jquast changed the title Text Sizing Protocol [DRAFT]\ Text Sizing Protocol support for width() and clip() May 1, 2026
@jquast jquast changed the title Text Sizing Protocol support for width() and clip() Improve width() and clip() for Text Sizing Protocl support May 1, 2026
@jquast jquast changed the title Improve width() and clip() for Text Sizing Protocl support Improve width() and clip() with kitty Text Sizing Protocol support May 1, 2026
@jquast jquast changed the title Improve width() and clip() with kitty Text Sizing Protocol support Improve width() and clip() with kitty Text Sizing Protocol May 1, 2026
@jquast jquast force-pushed the jq/text-sizing-protocol branch from ef92d4d to e79f38a Compare May 1, 2026 22:43
@jquast jquast force-pushed the jq/text-sizing-protocol branch from e79f38a to e46cab2 Compare May 1, 2026 23:02
@jquast jquast force-pushed the jq/text-sizing-protocol branch from 5285460 to 6988406 Compare May 1, 2026 23:10
@jquast jquast marked this pull request as ready for review May 1, 2026 23:11
@jquast jquast merged commit c09c237 into master May 2, 2026
31 checks passed
@jquast jquast deleted the jq/text-sizing-protocol branch May 2, 2026 14:40
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.

2 participants