• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

starwing / luautf8 / 19302506971 / 5
99%
master: 99%

Build:
DEFAULT BRANCH: master
Ran 12 Nov 2025 03:24PM UTC
Files 1
Run time 8s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Nov 2025 03:22PM UTC coverage: 99.025%. Remained the same
19302506971.5

push

github

starwing
feat!: add widthlimit API and modernize width functions (v0.2.0)

BREAKING CHANGES:
- `utf8.width()` and `utf8.widthindex()` now use integer `ambiwidth`
  parameter instead of boolean `ambi_is_double`
- New optional byte range parameters `i, j` added before `ambiwidth`

New Features:
- Add `utf8.widthlimit(s, i, j[, limit[, ambiwidth[, default]]])`
  - Unified function for width measurement and truncation
  - Positive limit: truncate from front (keep prefix)
  - Negative limit: truncate from back (keep suffix)
  - Omit limit: measure display width of byte range [i, j]
  - Returns: (pos, remain) where pos is truncation point or j if measuring
- Add `utf8.version` constant (set to "0.2.0")

API Changes:
- `utf8.width(s[, i[, j[, ambiwidth[, default]]]])`
  - Old: `utf8.width(s[, ambi_is_double[, default]])`
  - New: `ambi_is_double` (boolean) → `ambiwidth` (integer 1 or 2)
  - New: Optional byte range parameters `i, j` for substring width

- `utf8.widthindex(s, width[, i[, j[, ambiwidth[, default]]]])`
  - Same parameter changes as `utf8.width()`

Documentation:
- Rewrite all API docs in Lua official manual style
- Add comprehensive examples for all functions
- Add migration guide in Breaking Changes section
- Unify parameter naming: `s` (string), `i`/`j` (byte positions),
  `n` (character index)
- Fix grammar and formatting issues throughout README

Tests:
- Add comprehensive test coverage for `utf8.widthlimit()`
  - Basic truncation (positive/negative limits)
  - Fullwidth characters, mixed width strings
  - Substring ranges, ambiguous-width characters
  - Edge cases (empty strings, zero limit, out of bounds)
- Update existing tests for new API signatures

Migration Guide:
- `ambi_is_double = true` → `ambiwidth = 2`
- `ambi_is_double = false/nil` → `ambiwidth = 1` or omit
- Most users unaffected (only passing string parameter)

Version: 0.2.0

1117 of 1128 relevant lines covered (99.02%)

134488.72 hits per line

Source Files on job run-5.1 - 19302506971.5
  • Tree
  • List 1
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 19302506971
  • 004edf4e on github
  • Prev Job for on master (#19302386633.3)
  • Next Job for on master (#19305846848.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc