Debian Codegraph @

CHANGELOG.md

raw symbols SCIP
1 # Changelog
2
3 All notable changes to this project will be documented in this file.
4
5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
7 ## [7.2.3] - unreleased
8
9 ### Fix
10
11 ## [7.2.2] - 2026-01-13
12
13 ### Fix
14
15 - Minor performance improvements
16 - Fixed an edge-case, where multiple LowerBoundary constraints weren't uphold.
17 - Fixed an issue where tables were misformatted when no vertical border styling was specified. [#198](https://github.com/Nukesor/comfy-table/pull/198)
18
19 ## [7.2.1] - 2025-09-11
20
21 ### Misc
22
23 - Adjust a single test case to not fail in `0x0` sized tty-environments. [!186](https://github.com/Nukesor/comfy-table/pull/186)
24
25 ## [7.2.0] - 2025-08-25
26
27 ### Chore
28
29 - Switch to Rust 2024 edition. This bumps the MSRV to `1.85` and thereby no longer supports the [`wasm32-wasi` target](https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html).
30
31 ### Fix
32
33 - Also update the crossterm dependency to 0.29 for windows [!181](https://github.com/Nukesor/comfy-table/pull/181).
34
35 ## [7.1.4] - 2025-02-07
36
37 ### Fix
38
39 - Handle UTF-8 graphemes when truncating cells. [#167](https://github.com/Nukesor/comfy-table/pull/167)
40 - Respect UTF-8 zero-width joiner and variation selection characters when splitting words. [#168](https://github.com/Nukesor/comfy-table/pull/168) by [tisonkun](https://github.com/tisonkun)
41
42 ### Change
43
44 - Remove strum dependency. [#169](https://github.com/Nukesor/comfy-table/pull/169) by [tisonkun](https://github.com/tisonkun)
45 - Introduce the `unicode-segmentation` library in the scope of #167 and #168.
46 - The new changes for correct UTF-8 handling have a performance hit of up to ~67%.
47 However, this will most likely unnoticable for most people.
48 The benchmark table with 10 columns and 500 rows slowed down from 15ms to 25ms.
49 For "normal" tables, the performance hit is negligible.
50
51 ## Chore
52
53 - Bump ansi-str
54
55 ## [7.1.3] - 2024-11-24
56
57 ### Fix
58
59 - Bump `crossterm` to `0.28` on Windows as well
60
61 ## [7.1.2] - 2024-11-24
62
63 ### Chore
64
65 - Bump `crossterm` to `0.28`
66 - Bump `unicode-width` to `0.2`
67
68 ## [7.1.1] - 2024-04-05
69
70 ## Fix
71
72 - Fix string width calculation with ANSI escape sequences by switching to the `ansi-str` crate.
73 The previous implementation didn't respect OSC 8 hyperlink style ANSI sequences.
74 Implemented by [dsully](https://github.com/dsully) in [#137](https://github.com/Nukesor/comfy-table/pull/137).
75 - `custom_styling` feature now requires `tty` feature as it should.
76
77 ## [7.1.0] - 2023-10-21
78
79 ### Added
80
81 - Add helper methods `(col,row)_count` and `is_empty`. The first set of methods return the number of columns and rows
82 respectively. The method `is_empty` returns if the table is empty (contains no data rows). Implemented by
83 [Techassi](https://github.com/Techassi) in [#119](https://github.com/Nukesor/comfy-table/pull/119).
84
85 ### Chore
86
87 - Bump crossterm dependency
88
89 ## [7.0.1] - 2023-06-16
90
91 ## Fix
92
93 - Fix a panic when working with extreme paddings, where `(padding.left + padding.right) > u16::MAX`.
94 - Fix a panic when working with extremely long content, where `(content_width + padding) > u16::MAX`.
95 - Properly enforce lower boundary constraints.
96 Previously, "normal" columns were allocated before lower boundaries were respected.
97 This could lead to scenarios, where the table would grow beyond the specified size, when there was a lower boundary.
98 - Fix calculation of column widths for empty columns.
99 The minimum content width for a column is `1` char, but the `column_max_content_widths` function on the table returned a `0` width for fully empty columns.
100 This resulted in tables becoming larger than specified if there were any empty columns.
101
102 ## Misc
103
104 - Extend property tests, which lead to the discovery some bugs.
105
106 ## [7.0.0] - 2023-06-06
107
108 ### Breaking
109
110 - The `Color` and `Attribute` enum are no longer re-exported from crossterm by default.
111 Previously, when updating comfy-table, crossterm needed to be upgraded as well, since the compile would otherwise fail due to type incompatibilities.
112
113 To fix this, these enums are now mirrored and internally mapped to their crossterm equivalents, which allows us to safely bump crossterm whenever a new version is released.
114 This change will only affect you if your projects explicitly use crossterm and comfy-table at the same time **and** feed crossterm's native types into comfy-table.
115
116 If one wants the old behavior for convenience reasons, this can be enabled via a feature flag.
117 However, **this is also a opt-in to potential breaking changes on minor/patch versions**.
118
119 - Bump minimum version to v1.64
120
121 ### Added
122
123 - `reexport_crossterm` feature flag to enable old crossterm re-export.
124
125 ## [6.2.0] - 2023-05-26
126
127 ### Added
128
129 - Add support for custom ansi styling inside of cells. This feature is hidden behind the feature flag `custom_styling`. Implemented by [blueforesticarus](https://github.com/blueforesticarus) in [#93](https://github.com/Nukesor/comfy-table/pull/93).
130 - Add helper functions `add_row[s]_if`, which filtering of rows by a predicate. Implemented by [Techassi](https://github.com/Techassi) in [#106](https://github.com/Nukesor/comfy-table/pull/106).
131
132 ### Maintenance
133
134 - Bump dependencies
135
136 ## [6.1.4] - 2022-12-31
137
138 ### Added
139
140 - New preset `ASCII_FULL_CONDENSED` [#97](https://github.com/Nukesor/comfy-table/pull/97)
141
142 ## [6.1.3] - 2022-11-21
143
144 ### Fixed
145
146 - Disable unneeded crossterm `bracketed-paste` feature.
147
148 ## [6.1.2] - 2022-10-27
149
150 ### Fixed
151
152 - `Table::row_iter` no longer requires a `&mut self`, but only `&self`.
153
154 ## [6.1.1] - 2022-10-22
155
156 ### Fixed
157
158 - Fixed an issue where dynamic arrangement failed when setting the table to the exact width of the content [#90](https://github.com/Nukesor/comfy-table/issues/90).
159 - The header size is now properly respected in the final optimization step [#90](https://github.com/Nukesor/comfy-table/issues/90).
160 Previously, this wasn't the case and lead to weird formatting behavior when both of the following were true
161 - Dynamic content adjustment was active.
162 - The table didn't fit into the the available space.
163 - The header of a row was longer than its content.
164 - Fix wrong LowerBoundary calculation. This was introduced in commit bee764d, when this logic was refactored. [#90](https://github.com/Nukesor/comfy-table/issues/90).
165 - `Table::column_iter` no longer requires a `&mut self`, but only `&self`.
166
167 ### Added
168
169 - Expose current ContentArrangement for table via `table.content_arrangement`.
170
171 ## [6.1.0] - 2022-08-28
172
173 ### Added
174
175 - Add `Table::add_rows` to add multiple rows at the same time.
176
177 ### Misc
178
179 - Update crossterm to `v0.24`
180
181 ## [6.0.0] - 2022-05-31
182
183 ### Added
184
185 - Add `Table::style_text_only()`, which prevents non-delimiter whitespaces in cells to be styled.
186 - Add the `Table::discover_columns` function and add info on when to use it to `Row::add_cell`.
187
188 ### Breaking Changes
189
190 - Renaming of several functions to be Rust idiomatic:
191 - `Cell::get_content` -> `Cell::content`
192 - `Column::get_padding_width` -> `Column::padding_width`
193 - `Column::get_constraint` -> `Column::constraint`
194 - `Table::get_header` -> `Table::header`
195 - `Table::get_table_width` -> `Table::width`
196 - `Table::set_table_width` -> `Table::set_width`
197 - `Table::set_style` -> `Table::style`
198 - `Table::get_column` -> `Table::column`
199 - `Table::get_column_mut` -> `Table::column_mut`
200 - `Table::get_row` -> `Table::row`
201 - `Table::get_row_mut` -> `Table::row_mut`
202 - `Column::get_max_width` and `Column::get_max_content_width` have been removed as we cannot guarantee that these numbers are always correct.
203 Use `Table::column_max_content_widths` instead
204
205 ### Changed
206
207 - `Table::column_max_content_widths` now performs a full scan of the table's content when called.
208 - Don't include `Table::is_tty`, `Table::force_no_tty` and `Table::should_style` if `tty` feature isn't enabled.
209
210 ## [5.0.1] - 2022-02-18
211
212 ### Updates
213
214 - All dependencies have been bumped.
215
216 ## [5.0.0] - 2021-11-07
217
218 ### Updates
219
220 - All dependencies have been bumped.
221
222 ### Added
223
224 - Add option to use `stderr` for `is_tty` check [#25](https://github.com/Nukesor/comfy-table/pull/47).
225
226 ### Breaking
227
228 - Remove `ASCII_HORIZONTAL_BORDERS_ONLY` in favor of `ASCII_HORIZONTAL_ONLY`.
229 - Remove `UTF8_HORIZONTAL_BORDERS_ONLY` in favor of `UTF8_HORIZONTAL_ONLY`.
230
231 ## [4.1.1] - 2021-08-11
232
233 ### Added
234
235 - `tty` feature flag, which enables tty related functionality.
236 This includes styling and terminal-width detection.
237 The `tty` feature flag is enabled by default.
238 Implemented by [roee88](https://github.com/roee88) in [#47](https://github.com/Nukesor/comfy-table/pull/47).
239
240 ## [4.1.0] - 2021-08-09
241
242 ### Added
243
244 - Add `modifiers::UTF8_SOLID_INNER_BORDERS`, which makes the inner borders solid lines: `│─` by [ModProg](https://github.com/ModProg) for [#39](https://github.com/Nukesor/comfy-table/issues/39).
245 - Add `presets::ASCII_BORDERS_ONLY_CONDENSED`, which is `ASCII_BORDERS_ONLY` but without spacing between rows [#43](https://github.com/Nukesor/comfy-table/issues/43).
246
247 ### Fixed
248
249 - Several preset examples weren't correct.
250 - Multi-character UTF8 symbols are now handled correctly in most situations.
251 Table-layout might still break for 1-character columns.
252 - Mid-word splitting now takes multi-character utf8 characters into account.
253
254 ### Changed
255
256 - Rename `ASCII_HORIZONTAL_BORDERS_ONLY` to `ASCII_HORIZONTAL_ONLY`. Old imports will still work until v5.0.
257 - Rename `UTF8_HORIZONTAL_BORDERS_ONLY` to `UTF8_HORIZONTAL_ONLY`. Old imports will still work until v5.0.
258
259 ## [4.0.1] - 2021-07-08
260
261 ### Fixed
262
263 - Some docstrings on the `ColumnConstraint` and `Width` enum were wrong.
264
265 ## [4.0.0] - 2021-07-03
266
267 ### Added
268
269 - Add `Table::lines`, which returns an iterator over all lines of the final table output by [dmaahs2017](https://github.com/dmaahs2017) for [#35](https://github.com/Nukesor/comfy-table/issues/35).
270 - Add `ColumnConstraints::Boundaries{lower: Width, upper: Width}` to specify both an upper and a lower boundary.
271
272 ### Fixed
273
274 - Fixed percentages sometimes weren't correctly calculated, due to not taking border columns into account.
275 - Return `None` for `Table::get_table_width`, if getting the terminal size somehow failed.
276 - Fixed a lot of possible, but highly unlikely number conversion overflow issues.
277 - Run space optimization under all circumstances.
278 - Percentage constraints with values of >100 will now be capped to 100.
279 - The MinConstraint would be ignored when:
280 - The content was larger than the min constraint
281 - There was less space available than specified in the constraint.
282
283 ### Changed
284
285 - The way ColumnConstraints are initialized has been changed.
286 There is now
287
288 ```
289 enum ColumnConstraints {
290 ...,
291 /// Enforce a absolute width for a column.
292 Absolute(Width),
293 /// Specify a lower boundary, either fixed or as percentage of the total width.
294 LowerBoundary(Width),
295 /// Specify a upper boundary, either fixed or as percentage of the total width.
296 UpperBoundary(Width),
297 }
298
299 pub enum Width {
300 /// Specify a min amount of characters per line for a column.
301 Fixed(u16),
302 /// Set a a minimum percentage in respect to table_width for this column.
303 /// Values above 100 will be automatically reduced to 100.
304 /// **Warning:** This option will be ignored, if the width cannot be determined!
305 Percentage(u16),
306 }
307 ```
308
309 Instead of the old
310
311 ```
312 enum ColumnConstraints {
313 ...,
314 Width(u16),
315 MinWidth(u16),
316 MaxWidth(u16),
317 Percentage(u16),
318 MinPercentage(u16),
319 MaxPercentage(u16),
320 }
321 ```
322
323 ## [3.0.0] - 2021-06-13
324
325 ### Breaking changes
326
327 - Remove most custom traits and replace them with std's generic `From` trait. \
328 Check the docs on the trait implementations for Cell, Row and Cells
329 - Add the `Cells` type, to allow super generic `Iterator -> Row` conversions.
330
331 ## [2.1.0] - 2021-01-26
332
333 ### Added
334
335 - `DynamicFullWidth` arrangement.
336 This mode is basically the same as the `Dynamic` arrangement mode, but it will always use the full available width, even if there isn't enough content to fill the space.
337
338 ## [2.0.0] - 2021-01-16
339
340 ### Added
341
342 **Dynamic arrangement**
343
344 A new logic to optimize space usage after splitting content has been added.\
345 If there is a lot of unused space after the content has been arranged, this space will now be redistributed to the remaining columns.
346 Or it will be removed if there are no other columns.
347
348 **This is considered a breaking change, since this can result in different table layouts!!**
349
350 This process is far from perfect, but the behavior is better than before.
351
352 Old behavior:
353
354 ```
355 +-----------------------------------+-----------------------------------+------+
356 | Header1 | Header2 | Head |
357 +==============================================================================+
358 | This is a very long line with a | This is text with a | smol |
359 | lot of text | anotherverylongtexttesttest | |
360 +-----------------------------------+-----------------------------------+------+
361 ```
362
363 New behavior:
364
365 ```
366 +-----------------------------------------+-----------------------------+------+
367 | Header1 | Header2 | Head |
368 +==============================================================================+
369 | This is a very long line with a lot of | This is text with a | smol |
370 | text | anotherverylongtexttesttest | |
371 +-----------------------------------------+-----------------------------+------+
372 ```
373
374 Old behavior:
375
376 ```
377 +------------------------------------------------+
378 | Header1 |
379 +================================================+
380 | This is text with a |
381 | anotherverylongtexttesttestaa |
382 +------------------------------------------------+
383 ```
384
385 New behavior:
386
387 ```
388 +-------------------------------+
389 | Header1 |
390 +===============================+
391 | This is text with a |
392 | anotherverylongtexttesttestaa |
393 +-------------------------------+
394 ```
395
396 ## [1.6.0] - 2021-01-16
397
398 ### Added
399
400 - Add the `NOTHING` preset, which prints no borders or lines at all.
401
402 ## [1.5.0] - 2020-12-29
403
404 ### Added
405
406 - Add `table::trim_fmt`, which trims all trailing whitespaces on tables with no right border.
407
408 ## [1.4.0] - 2020-12-06
409
410 ### Added
411
412 - Allow to set custom delimiters on tables, columns and cells.
413
414 ### Changed
415
416 - Expose all important traits. I.e. `ToRow`, `ToCell` and `ToCells`.
417
418 ## [1.3.0] - 2020-11-20
419
420 ### Added
421
422 - New ColumnConstraint for hiding columns
423
424 ## [1.2.0] - 2020-10-27
425
426 ### Added
427
428 - Add the option to set a max-height on rows. Long content will be truncated.
429
430 ## [1.1.1] - 2020-08-23
431
432 ### Changed
433
434 - A simple update of all dependencies.
435
436 ## [1.1.0] - 2020-08-23
437
438 ### Changed
439
440 - Move `is_tty` logic from `atty` to `crossterm`.
441 - Remove `skeptic`, since it fails in CI and bloats compile time. Compile time is reduced by ca. 40%.
442
443 ## [1.0.0] - 2020-07-07
444
445 ### Changed
446
447 - The project has been in use for quite some time and seems to be quite stable!
448 - Use cargo's `example` functionality for examples.
449
450 ## [0.1.1] - 2020-05-24
451
452 ### Added
453
454 - `Column::get_max_width()`, which returns the character count of the widest line in this column including padding.
455 - `current_style_as_preset` method for convenient conversion of a style into a preset
456 - New Markdown like table style prefix. Thanks to [joeydumont](https://github.com/joeydumont).
457
458 ## [0.1.0] - 2020-03-21
459
460 ### Added
461
462 - Better test coverage
463
464 ### Fixed
465
466 - Fixed a bug with broken percentage constraints for super wide tables.
467
468 ## [0.0.7] - 2020-02-09
469
470 ### Added
471
472 - Introduce proptest
473
474 ### Fixed
475
476 - Fix wrong calculation due to bytes count instead of char count
477 - Fix panics caused by wrong string splits
478
479 ## [0.0.6] - 2020-01-31
480
481 ### Changed
482
483 - Crossterm 0.15 update
484 - Simplify the project's module structure
485
486 ## [0.0.5] - 2020-01-29
487
488 ### Added
489
490 - Add `Column::remove_constraint()`
491 - Preset `UTF8_NO_BORDERS`
492 - Preset `UTF8_HORIZONTAL_BORDERS_ONLY`
493
494 ## [0.0.4] - 2020-01-27
495
496 ### Added
497
498 - Add skeptic tests
499 - Add code coverage
500 - A lot more tests
501
502 ### Changed
503
504 - Removed `Hidden` Constraint