regex-syntax
to 0.8.syntect::util::split_at()
handles multi-byte charactersPartialEq
for Theme
fancy-regex
to 0.11regex-syntax
to 0.7lazy_static
with once_cell
Debug
impl of syntect::highlighting::Color
less verboseBreaking changes
ContextId::new()
from public API to support lazy-loading of syntaxesHighlightLines::highlight()
to HighlightLines::highlight_line()
to make it clear that the function takes one line at a timeplist
dependency (used for loading themes) optional via new plist-load
featuredump-load-rs
and dump-create-rs
features that has been identical to dump-load
and dump-create
for two yearsThemeSettings::highlight_foreground
, ThemeSettings::selection_background
, ClassedHTMLGenerator::new
, ClassedHTMLGenerator::parse_html_for_line
, html::css_for_theme
, html::tokens_to_classed_html
and html::tokens_to_classed_spans
#[non_exhaustive]
Result
to allow propagation of errors:html::ClassedHTMLGenerator::parse_html_for_line_which_includes_newline
html::append_highlighted_html_for_styled_line
html::css_for_theme_with_class_style
html::highlighted_html_for_string
html::line_tokens_to_classed_spans
html::styled_line_to_highlighted_html
parsing::ParseState::parse_line
parsing::ScopeStack::apply
parsing::ScopeStack::apply_with_hook
parsing::syntax_definition::Context::match_at
parsing::syntax_definition::ContextReference::id
parsing::syntax_definition::ContextReference::resolve
Other changes
Plain Text
if a referenced syntax is missinghidden_file_extensions
key in syntaxes.Error
and Display
for all error enums by using thiserror
lazycell
with once_cell
to fix crash on lazy initializationScopeRangeIterator
from_dump_file()
~15% fasterfrom_dump_file()
This version was yanked from crates.io due to a semver violation issue.
This version was yanked from crates.io due to a semver violation issue.
html::line_tokens_to_classed_spans
to also take a mutable ScopeStack, deprecate tokens_to_classed_spans
, to avoid panics and incorrect highlighting.find_unlinked_contexts
to SyntaxSet
syntaxes
method to SyntaxSetBuilder
fancy-regex
to v0.7 and yaml-rust
to v0.4.5Send + Sync + 'static
#304html
feature on the assets
feature. #300html
module CSS class names. #296onig
and plist
. The new onig
version doesn't require bindgen
thus making compilation easier. #293Thanks @sharkdp for the bug fixes! Bumping second part of semver since Send
is adding functionality (back).
fancy-regex
engine optionUsers can now opt in to a pure-Rust regex engine using Cargo features, making compilation easier in general. People experiencing difficulty compiling for Windows and Wasm should try switching to fancy-regex
. Note this currently approximately halves highlighting speed.
See the Readme and #270 for details. Thanks to @robinst for implementing this!
Upgrading should cause no errors for nearly all users. Users using more unusual APIs may have a small amount of tweaking to do.
default-features = false
you may need to update your features to choose a regex engineBug fixes and new utilities
as_latex_escaped
utiltokens_to_classed_spans
public like intendedMetadata and new classed HTML generation
plist
to v0.4
and pretty_assertions
to v0.6
(#232 #236)Bug fixes
with_prototype
s (#220, fixes #160, #178, ASP highlighting)Minor bug fixes
Breaking changes and major new features
This is a major release with multiple breaking API changes, although upgrading shouldn't be too difficult. It fixes bugs and comes with some nice new features.
SyntaxSet
API has been revamped to use a builder and an arena of contexts. See example usage.SyntaxSet
that goes with the rest of their arguments because of this new arena.LoadingError::ParseSyntax
html
module now take the newlines
version of syntaxes.SyntaxSet::add_syntax -> SyntaxSetBuilder::add
SyntaxSet::load_syntaxes -> SyntaxSetBuilder::add_from_folder
SyntaxSet::load_plain_text_syntax -> SyntaxSetBuilder::add_plain_text_syntax
html::highlighted_snippet_for_string -> html::highlighted_html_for_string
: also change to newlines
SyntaxSet
html::highlighted_snippet_for_file -> html::highlighted_html_for_file
: also change to newlines
SyntaxSet
html::styles_to_coloured_html -> html::styled_line_to_highlighted_html
: also change to newlines
SyntaxSet
html::start_coloured_html_snippet -> html::start_highlighted_html_snippet
: return type also changedSyntaxSetBuilder
API for constructing new SyntaxSet
snonewlines
mode is often buggy so we made it easier to use the newlines
mode.LinesWithEndings
utility for iterating over the lines of a string with \n
characters.html
module to use newlines
syntaxes.split_at
and modify_range
in the util
module.ThemeSet::add_from_folder
function (#200): For modifying existing theme sets.set
: #177 #166embed
to not include prototypes: #172 #1600.2 -> 0.3
0.2 -> 1.0
3.2.1 -> 4.1
Regex checking and plain file names
CMakeLists.txt
nonewlines
mode marginally less buggy (still prefer using newlines
mode)More robust parsing
Thanks to @robinst for the headline features of this release!
Breaking Changes and New Stuff
static-onig
feature was removed, static linking is now the defaultSyntaxDefinition::load_from_str
now has an extra parameterembed
syntax, see #124New Inspired GitHub and libonig
Update bitflags & packages
This release changes how the constants for FontStyle
and Color
, relying on the new associated consts feature in Rust 1.20
. The old constants are still available but are deprecated and will be removed in v2.0
.
Packages were also updated to newer versions.
Enable comparison of parse states
Fixes comparisons of parse states so they are fast and don't recurse infinitely. Thanks @raphlinus
Bug fixes and package updates
syncat
examplePure Rust dump loading / creation features
Helper methods and more theme attributes
Highlighting stacks
Small release, adds a convenience method for highlighting an entire stack, and derives some more things on Scope
.
Serde and optional parsing
This release switches the dump format from rustc-serialize
to Serde
, anyone using custom dumps will have to update them.
It also makes the parsing part of the library optional behind a feature flag, anyone not using the default feature flags probably will want to add the parsing
flag.
Bug fixes, tests, updates and feature flags
syntest
example for running Sublime Text syntax tests