diff options
| author | 2025-04-30 11:58:19 -0400 | |
|---|---|---|
| committer | 2025-04-30 11:58:19 -0400 | |
| commit | 1be5e46490e061761b4b97dff5c6acb2181d6fe9 (patch) | |
| tree | 77a1edcdedd7afae7428e92feba37d2bb1035b22 /NEWS.md | |
| parent | Add general tests step (diff) | |
| download | zg-1be5e46490e061761b4b97dff5c6acb2181d6fe9.tar.gz zg-1be5e46490e061761b4b97dff5c6acb2181d6fe9.tar.xz zg-1be5e46490e061761b4b97dff5c6acb2181d6fe9.zip | |
Factor out 'Data' for grapheme and DisplayWidth
In the process of refactoring the whole library, so that it doesn't
expose anything called "Data" separately from user functionality.
Diffstat (limited to 'NEWS.md')
| -rw-r--r-- | NEWS.md | 46 |
1 files changed, 46 insertions, 0 deletions
| @@ -0,0 +1,46 @@ | |||
| 1 | # News | ||
| 2 | |||
| 3 | ## zg v0.14.0 Release Notes | ||
| 4 | |||
| 5 | This is the first minor point release since Sam Atman (me) took over | ||
| 6 | maintenance of `zg` from the inimitable José Colon, aka | ||
| 7 | @dude_the_builder. | ||
| 8 | |||
| 9 | As it's a fairly complex project, I'm adding a NEWS.md so that users | ||
| 10 | have a place to check for changes. | ||
| 11 | |||
| 12 | ### Data is Unmanaged | ||
| 13 | |||
| 14 | This is the biggest change. Prior to `v0.14`, all structs which need | ||
| 15 | heap allocation no longer have a copy of their allocator. It was felt | ||
| 16 | that this was redundant, especially when several such structures were | ||
| 17 | in use, and it reflects a general trend in the standard library toward | ||
| 18 | fewer managed data structures. | ||
| 19 | |||
| 20 | Getting up to speed is a matter of passing the allocator to `deinit`. | ||
| 21 | |||
| 22 | This change comes courtesy of [lch361](https://lch361.net), in his | ||
| 23 | first contribution to the repo. Thanks Lich! | ||
| 24 | |||
| 25 | ### Grapheme Iterator Creation | ||
| 26 | |||
| 27 | This is a modest streamlining of how a grapheme iterator is created. | ||
| 28 | |||
| 29 | Before: | ||
| 30 | |||
| 31 | ```zig | ||
| 32 | const gd = try grapheme.GraphemeData.init(allocator); | ||
| 33 | defer gd.deinit(); | ||
| 34 | var iter = grapheme.Iterator.init("🤘🏻some rad string! 🤘🏿", &gd); | ||
| 35 | ``` | ||
| 36 | |||
| 37 | Now: | ||
| 38 | |||
| 39 | ```zig | ||
| 40 | const gd = try grapheme.GraphemeData.init(allocator); | ||
| 41 | defer gd.deinit(allocator); | ||
| 42 | var iter = gd.iterator("🤘🏻some rad string! 🤘🏿"); | ||
| 43 | ``` | ||
| 44 | |||
| 45 | You can still make an iterator with `grapheme.Iterator.init`, but the | ||
| 46 | second argument has to be `&gd.gd`. | ||