Skip to content

Clarify tab handling with enum API#3

Merged
ainame merged 3 commits intomainfrom
codex/improve-tab-width
Apr 6, 2026
Merged

Clarify tab handling with enum API#3
ainame merged 3 commits intomainfrom
codex/improve-tab-width

Conversation

@ainame
Copy link
Copy Markdown
Owner

@ainame ainame commented Apr 6, 2026

Summary

  • replace the ambiguous tabWidth option with tab: DisplayWidth.Tab
  • support both terminal-style tab stops and fixed-space tab counting
  • add tests and diagram-style docs to clarify the behavior difference

Details

  • DisplayWidth.Tab.tabStops(n) advances to the next multiple of n
  • DisplayWidth.Tab.fixedSpaces(n) counts each tab as exactly n columns
  • tab: nil keeps the previous default behavior where is measured as width 0
  • stripsANSI and tab still affect string measurement only

Testing

  • swift test

@ainame ainame merged commit 8f8e1d8 into main Apr 6, 2026
1 check passed
@ainame ainame deleted the codex/improve-tab-width branch April 6, 2026 19:39
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.

1 participant