All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased - ReleaseDate
0.12.16 - 2026-05-06
- Correctly format suggestion paths when DecorStyle::Unicode #414
- Correctly highlight multi-line removals that leave only whitespace #413
0.12.15 - 2026-04-06
- Source highlighting no longer misaligns when source contains zero-width or multi-width characters #400
0.12.14 - 2026-04-04
- Don't trim middle of spans smaller than padding + margin
- Properly handle replacement length mismatches
- Account for "gutter" width when trimming middle of long spans
- Account for left trim when trimming middle of long spans
0.12.13 - 2026-03-04
0.12.12 - 2026-02-18
- Add
no_stdsupport #365
0.12.11 - 2026-01-29
- Fix Unicode highlight alignment in patches #357
0.12.10 - 2025-12-01
- Render all removed lines when multiple Patch remove lines #353
0.12.9 - 2025-11-15
- Prefer exact prefix/suffix matches when trimming replacements #345
0.12.8 - 2025-10-28
- No longer panic when annotating leading whitespace #334
0.12.7 - 2025-10-24
- Correctly calculate annotation offsets when trimming unicode characters #331
0.12.6 - 2025-10-22
- Upgraded
unicode-widthto0.2.2#326- This update adds support for Unicode 16 and 17, and can affect character width calculations
- Use straight arrows for standalone
Origin#327
- Correctly calculate line numbers for trimmed multi-line suggestions #321
- Respect
.fold(false)when set on suggestions #322 - Properly calculate the max line number width for suggestions #323
- Show full line when
Patchspan points to line end #324
0.12.5 - 2025-10-14
- Highlight the correct span for duplicated diff lines #318
0.12.4 - 2025-09-11
- Removed implicit padding with report starting with secondary title #310
0.12.3 - 2025-09-04
- Add
Title::elementfor less boilerplate - Add
renderer::DEFAULT_*_STYLEto expose default styles
- Clarify role of
Renderer::<style>methods
0.12.2 - 2025-09-03
- Duplicate multi-line annotations get treated like the are distinct #293
- Allow passing
0toSnippet::line_start#294
0.12.1 - 2025-09-02
- Correctly calculate line number width when feature
simdis enabled #286 - Close the "code window" when the last line of a
Snippethas no annotations and nothing comes after it #288
0.12.0 - 2025-08-28
Note that the top-level type changed from Message to Report.
Message is now a single block of text within a Report.
- Replace
Message::footerwith either- adding a
Messageto aGroup - starting a new
Group
- adding a
- Replace
Level::<Variant>withLevel::<VARIANT>, e.g.Level::Error->Level::ERROR - Instead of creating
Snippets on aMessage(the type returned byLevel::title), add them to theGroupthat is created with theTitle Snippet::originhas been renamed toSnippet::path- Instead of creating an
Annotationfrom aLevel, create them from anAnnotationKindAnnotationKind::Primarywill automatically match theLevelof theGroup- All others existing annotations should likely be
AnnotationKind::Context
Level::titlehas been replaced withLevel::primary_level(for firstGroup) andLevel::secondary_level(subsequentGroups)Message::idhas moved toTitle::id- Renamed
Renderer::line_notoRenderer::line_num - Add
snippet.fold(false)if unspecified, removingsnippet.fold(true)if specified
- Added unicode decor support, see
renderer::DecorStyle - Created [
Group] to indicate what all is included between the unicode begin and end decor - Added
Level::secondary_titleto allow for custom ANSI escape code styling to be applied to thoseTitles - Added
AnnotationKind::Visibleto force spans to be visible within a Snippet, despite code folding, without any visible marker - Added
Originfor referencing code without the source - Added
Group::with_levelto allowSnippets without aTitle - Added
Level::no_nameto hide the level name - Added
Level::with_nameto override what is rendered for that level - Added
Title::id_urlto turnTitle::idinto a link - Added
Patchfor displaying changes to code
- Switched strings to
Cow<str>to allow for easier management of owned data Snippet::pathnow acceptsNoneAnnotation::labelnow acceptsNone- Various rendering fixes
0.11.5 - 2024-12-09
rustc's multiline annotation special case #133- This special case happens when:
- The start of a multiline annotation is at the start of the line disregarding any leading whitespace
- No other multiline annotations overlap it
- This special case happens when:
simdfeature for faster folding #146
- Multiline annotations with matching spans get merged #133
- Multiple annotations on one line are no longer rendered on separate lines #133
- Overlapping multiline annotations are now correctly rendered #133
- Origin position is now correctly calculated when an annotation starts at the beginning of the line #154
0.11.4 - 2024-06-15
- Annotations for
\r\nare now correctly handled #131
0.11.3 - 2024-06-06
- Dropped MSRV to 1.65
0.11.2 - 2024-04-27
- All public types now implement
Debug#119
0.11.1 - 2024-03-21
- Switch
foldto use rustc's logic: always show first and last line of folded section and detect if its worth folding - When
folding the start of asource, don't show anything, like we do for the end of thesource - Render an underline for an empty span on
Annotations
0.11.0 - 2024-03-15
- Switched from char spans to byte spans #90
- Renamed
AnnotationTypetoLevel#94 - Renamed
SourceAnnotationtoAnnotation#94 - Renamed
SnippettoMessage#94 - Renamed
SlicetoSnippet#94 Message,Snippet,AnnotationandLevelcan only be built with a builder pattern #91 and #94Annotationlabels are now optional #94Annotationnow takes inRange<usize>instead of(usize, usize)#90Marginis now an internal detail, onlyterm_widthis exposed #105footerwas generalized to be aMessage#98
term_widthwas added toRendererto control the rendering width #105- defaults to 140 when not set
Margins are now calculated perSnippet, rather than for the entireMessage#105Annotations can be created without labels
footerwas expanded to allow annotating sources by acceptingMessage#98
0.10.2 - 2024-02-29
- Added
testing-colorsfeature to remove platform-specific colors when testing #82
0.10.1 - 2024-01-04
- Set the minimum supported Rust version to
1.73.0#71
0.10.0 - December 12, 2023
Rendereris now used for displaying aSnippet#67Rendereralso controls the color scheme and formatting of the snippet
- Moved everything in the
snippetto be in the crate root #67
Renderernow controls the color scheme and formatting ofSnippets #67- Removed the
StyleandStylesheettraits, as color is controlled byRenderer#67 - Replaced
yansi-termwithanstyle#67anstyleis designed primarily to exist in public APIs for interoperabilityanstyleis re-exported underannotate_snippets::renderer
- Removed the
colorfeature in favor ofRenderer::plain()#67 - Moved
Margintorenderermodule #67 - Made the
display_listmodule private #67
0.9.2 - October 30, 2023
- Remove parsing of __ in title strings, fixes (#53)
- Origin line number is not correct when using a slice with fold: true (#52)
0.9.1 - September 4, 2021
- Fix character split when strip code. (#37)
- Fix off by one error in multiline highlighting. (#42)
- Fix display of annotation for double width characters. (#46)
0.9.0 - June 28, 2020
- Add strip code to the left and right of long lines. (#36)
0.8.0 - April 14, 2020
- Replace
ansi_termwithyansi-termfor improved performance. (#30) - Turn
SnippetandSliceto work on borrowed slices, rather than Strings. (#32) - Fix
\r\nend of lines. (#29)
0.7.0 - March 30, 2020
- Refactor API to use
fmt::Display(#27) - Fix SourceAnnotation range (#27)
- Fix column numbers (#22)
- Derive
PartialEqforAnnotationType(#19) - Update
ansi_termto 0.12.
0.6.1 - July 23, 2019
- Fix too many anonymized line numbers (#5)
0.6.0 - June 26, 2019
- Add an option to anonymize line numbers (#3)
- Transition the crate to rust-lang org.
- Update the syntax to Rust 2018 idioms. (#4)