Releases: FIameCaster/prism-code-editor
Release 2.4.0
New features
Better comment toggling for JSX
When inside a JSX context, normal JavaScript comments can't be used. Therefore {/* */}
comments will now be used in JSX contexts.(2e38fd2)
A new property on languages getComments
was used to make this possible. You can read about it in the API docs.
New commands
- Shift+Ctrl+K (Shift+Cmd+K on MacOS): Delete line (617da31)
- Ctrl+Enter (Cmd+Enter on MacOS) Insert blank line (7ee34a4)
Fixes
- Tag matching and block comment folding now works properly in nested languages (9bab6a3)
- The JS templates and markup templating Prism languages can no longer break tag matching, bracket matching and code folding
Release 2.3.2
Fixed highlighting when there are tags inside object spread in JSX tags (9ec5299)
Fixed backtracking issues with the new tag patterns for JSX and markup
Improved an edge case when toggling comments in languages without line comments such as CSS or markup (edcc167)
Fixed a bug in the Prism core where the rest
property of grammars wasn't ignored by the matchGrammar
function
Release 2.3.1
Release 2.3.0
New features
- Added a parameter to
SearchAPI.search
which allows you to change the behavior of whole word search (a585839) - The
highlightSelectionMatches
andhighlightCurrentWord
extensions now expose their search API which can be used to e.g. get the positions of the current matches (38e9f0b) - Added source maps to the package for easier debugging (35c96d3)
Improvements and fixes
- The
matchTags
extension now correctly handles name spaced tags and matches tags inside attribute values (3e55338) - Improved the tag pattern i both JSX and markup. The attribute value has been made optional, and whitespace is now allowed around =, so
<div id=>
and<div id = "a">
are now highlighted as tags which improves typing experience. Lastly, JSX tag names and attribute names now allow non-ASCII characters (5553f09) - Small improvements to the JavaScript grammar (5553f09)
- Improved word boundries for searching in the
highlightCurrentWord
extension (ea955f7) - Fixed a couple bugs in the
highlightTagPunctuation
extension (6dbdb27) - Creating an editor or calling
setOptions
with thevalue
option explicitly set toundefined
no longer throws an error (5faa832) - Constants are now colored differently in the VS Code Light/Dark themes (2f4f534)
Release 2.2.4
- Improved whole word search behavior
- A Chrome bug patch for the search widget didn't always work. It now does
Release 2.2.3
- Fixed PrismJS/prism#3722 for the Kotlin grammar
- Improved whole word search
- Opening the search widget programmatically now starts a search with the find input's contents.
- Fixed opening punctuation of JSX fragments being highlighted by the
matchTags
extension
Release 2.2.2
- Fix empty search match before UTF-16 surrogate pair causing infinite loop (5fa8c2c)
- Search filter is now called with the correct start and end parameters when only a part of the document is searched (5fa8c2c)
- Slightly altered appearance of empty search matches (5fa8c2c)
- Improved javascript template strings. Previously strings with empty interpolation expressions such as
`a${}b`
would not be highlighted as a template string. Now it will be, improving UX while typing (3887da8)
Release 2.2.1
Release 2.2.0
Improvements
Including hyphens in the search wasn't wanted for most languages. Therefore a new parameter was added to the highlightCurrentWord
extension.
const selector = ".string, .comment, .keyword, .regex"
const filter = start => !getClosestToken(editor, selector, 0, 0, start)
const includeHyphens = position => getLanguage(editor, position) == "css"
editor.addExtensions(
highlightCurrentWord(filter, includeHyphens)
)
Fixes
In TSX, opening tags comming directly after another tag are now highlighted. This was an issue with Prism's TSX grammar.
Release 2.1.0
New features
- Added a word highlighting extension.
import { highlightCurrentWord } from "prism-code-editor/search"
const selector = ".string, .comment, .keyword, .regex"
const filter = start => !getClosestToken(editor, selector, 0, 0, start)
editor.addExtensions(
highlightCurrentWord(filter)
)
- Added a filter parameter to
SearchAPI.search
(6786676)