feat(progress): strip ANSI sequences for sprite width calculations#207
feat(progress): strip ANSI sequences for sprite width calculations#207Gitkbc wants to merge 1 commit intolunarmodules:mainfrom
Conversation
Tieske
left a comment
There was a problem hiding this comment.
This PR has 2 changes; titles, and sprites/progress. But you committed them all in a single commit. It's best practice to have 1 change per commit, and keep them atomic.
This is another AI generated PR, and it has the same issues, a lack of understanding of the problem.
|
|
||
|
|
||
| it("strips ANSI codes when title truncation is needed", function() | ||
| local result = line.title_seq(8, "\27[31mVeryLongTitle\27[0m") |
There was a problem hiding this comment.
this is a nasty edgecase, hadn't thought about it. This needs a solution I think.
|
|
||
| - a fix | ||
| - a change | ||
| - feat(progress): strip ANSI sequences for sprite width calculations. |
There was a problem hiding this comment.
no changelog needed for now, since there is no release yet
|
Thanks for the review and feedback, @Tieske Sir You're right — title handling and sprite/ANSI width handling are two separate concerns and should not have been combined in a single commit. I'll split them into proper atomic commits and remove the CHANGELOG I'll push an updated branch shortly. Appreciate the guidance. |
Implements #203.
Spinner and ticker width calculations now ignore ANSI escape sequences
by stripping them before computing visible width. This allows colored
or styled sprites without breaking cursor rewind behavior.
Title rendering was updated to ignore ANSI sequences for width math,
while preserving them when no truncation is required.