Skip to content

fmt: fix map value aligment when using keys with uft8 symbols - #19689

Merged
medvednikov merged 3 commits into
vlang:masterfrom
ttytm:fmt/fix-map-val-align-with-uf8-keys
Oct 29, 2023
Merged

medvednikov merged 3 commits into
vlang:masterfrom
ttytm:fmt/fix-map-val-align-with-uf8-keys

Conversation

@ttytm

@ttytm ttytm commented Oct 28, 2023 •

Copy link
Copy Markdown
Member

Fixes #16572

πŸ€– Generated by Copilot at 24dc1d5

Fix alignment of map literals with non-ASCII keys in v fmt. Add a new test case with UTF-8 keys and values to vlib/v/fmt/tests.

πŸ€– Generated by Copilot at 24dc1d5

  • Use utf8_str_visible_length instead of len_utf8 to align map literals with UTF-8 keys (link, link)
  • Add a test case for map literals with UTF-8 keys and values in maps_input.vv and maps_expected.vv (link, link)

Comment thread vlib/v/fmt/tests/maps_expected.vv Outdated
@medvednikov
medvednikov merged commit fd04c9d into vlang:master Oct 29, 2023
@ttytm
ttytm deleted the fmt/fix-map-val-align-with-uf8-keys branch November 1, 2023 19:47
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.

UTF-8 symbols in key names break fmt format for a map

3 participants