Version history and release notes of the core packages.

@codemirror/language 6.1.0 (2022-06-20)

New features

The foldState field is now public, and can be used to serialize and deserialize the fold state.

@codemirror/state 6.0.1 (2022-06-17)

Bug fixes

Fix a problem that caused effects' map methods to be called with an incorrect change set when filtering changes.

@codemirror/view 6.0.1 (2022-06-17)

Bug fixes

Avoid DOM selection corruption when the editor doesn't have focus but has selection and updates its content.

Fall back to dispatching by key code when a key event produces a non-ASCII character (so that Cyrillic and Arabic keyboards can still use bindings specified with Latin characters).

@codemirror/language-data 6.1.0 (2022-06-17)

New features

Add a LanguageDescription for Sass.

@codemirror/autocomplete 6.0.2 (2022-06-15)

Bug fixes

Declare package dependencies as peer dependencies as an attempt to avoid duplicated package issues.

@codemirror/autocomplete 6.0.1 (2022-06-09)

Bug fixes

Support escaping ${ or #{ in snippets.

@codemirror/state 6.0.0 (2022-06-08)

Breaking changes

Update dependencies to 6.0.0

@codemirror/view 6.0.0 (2022-06-08)

New features

The new static EditorView.findFromDOM method can be used to retrieve an editor instance from its DOM structure.

Instead of passing a constructed state to the EditorView constructor, it is now also possible to inline the configuration options to the state in the view config object.

@codemirror/language 6.0.0 (2022-06-08)

New features

The foldingChanged option to foldGutter can now be used to trigger a recomputation of the fold markers.

@codemirror/commands 6.0.0 (2022-06-08)

Bug fixes

Fix a bug where by-page selection commands sometimes moved one line too far.

@codemirror/search 6.0.0 (2022-06-08)

Bug fixes

Don't crash when a custom search panel doesn't have a field named 'search'.

Make sure replacements are announced to screen readers.

@codemirror/autocomplete 6.0.0 (2022-06-08)

Bug fixes

Scroll the cursor into view when inserting a snippet.

@codemirror/lint 6.0.0 (2022-06-08)

Breaking changes

Update dependencies to 6.0.0

@codemirror/collab 6.0.0 (2022-06-08)

Breaking changes

Update dependencies to 6.0.0

@codemirror/language-data 6.0.0 (2022-06-08)

Breaking changes

Update dependencies to 6.0.0

codemirror 6.0.0 (2022-06-08)

Breaking changes

Change the package name from @codemirror/example-setup to just codemirror.

The package no longer exports EditorState (since that is no longer necessary to set up a basic editor).

New features

The new minimalSetup export provides a minimal set of editor extensions.

@codemirror/state 0.20.1 (2022-06-02)

New features

EditorView.phrase now accepts additional arguments, which it will interpolate into the phrase in the place of $ markers.

@codemirror/view 0.20.7 (2022-05-30)

Bug fixes

Fix an issue on Chrome Android where the DOM could fail to display the actual document after backspace.

Avoid an issue on Chrome Android where DOM changes were sometimes inappropriately replace by a backspace key effect due to spurious beforeinput events.

Fix a problem where the content element's width didn't cover the width of the actual content.

Work around a bug in Chrome 102 which caused wheel scrolling of the editor to be interrupted every few lines.

@codemirror/autocomplete 0.20.3 (2022-05-30)

Bug fixes

Add an aria-label to the completion listbox.

Fix a regression that caused transactions generated for completion to not have a userEvent annotation.

@codemirror/lint 0.20.3 (2022-05-25)

New features

Diagnostic objects may now have a renderMessage method to render their message to the DOM.

@codemirror/autocomplete 0.20.2 (2022-05-24)

New features

The package now exports an insertCompletionText helper that implements the default behavior for applying a completion.

@codemirror/view 0.20.6 (2022-05-20)

Bug fixes

Make sure the editor re-measures itself when its attributes are updated.

@codemirror/language 0.20.2 (2022-05-20)

Bug fixes

List style-mod as a dependency.

@codemirror/view 0.20.5 (2022-05-18)

Bug fixes

Fix an issue where gutter elements without any markers in them would not get the cm-gutterElement class assigned.

Fix an issue where DOM event handlers registered by plugins were retained indefinitely, even after the editor was reconfigured.

@codemirror/language 0.20.1 (2022-05-18)

Bug fixes

Make sure all styles in the CSS generated for a HighlightStyle have a lower precedence than the other rules defined for the style. Use a shorthand property

@codemirror/autocomplete 0.20.1 (2022-05-16)

New features

The new closeOnBlur option determines whether the completion tooltip is closed when the editor loses focus.

CompletionResult objects with filter: false may now have a getMatch property that determines the matched range in the options.

@codemirror/view 0.20.4 (2022-05-03)

Bug fixes

Prevent Mac-style behavior of inserting a period when the user inserts two spaces.

Fix an issue where the editor would sometimes not restore the DOM selection when refocused with a selection identical to the one it held when it lost focus.

@codemirror/lint 0.20.2 (2022-05-02)

New features

The package now exports the LintSource function type.

The new markerFilter and tooltipFilter options to linter and lintGutter allow more control over which diagnostics are visible and which have tooltips.

@codemirror/view 0.20.3 (2022-04-27)

Bug fixes

Fix a bug where the input handling could crash on repeated (or held) backspace presses on Chrome Android.

@codemirror/view 0.20.2 (2022-04-22)

New features

The new hideOn option to hoverTooltip allows more fine-grained control over when the tooltip should hide.

@codemirror/search 0.20.1 (2022-04-22)

New features

It is now possible to disable backslash escapes in search queries with the literal option.

@codemirror/lint 0.20.1 (2022-04-22)

Bug fixes

Hide lint tooltips when the document is changed.

@codemirror/state 0.20.0 (2022-04-20)

Breaking changes

The deprecated precedence names fallback, extend, and override were removed from the library.

Bug fixes

Fix a bug where, if an extension value occurs multiple times, its lowest, rather than highest precedence is used.

Fix an issue where facets with computed inputs would unneccesarily have their outputs recreated on state reconfiguration.

Fix a bug in the order in which new values for state fields and facets were computed, which could cause dynamic facets to hold the wrong value in some situations.

New features

The exports from @codemirror/rangeset now live in this package.

The exports from @codemirror/text now live in this package.

@codemirror/view 0.20.1 (2022-04-20)

Bug fixes

Remove debug statements that accidentally made it into 0.20.0.

Fix a regression in moveVertically.

@codemirror/view 0.20.0 (2022-04-20)

Breaking changes

The deprecated interfaces blockAtHeight, visualLineAtHeight, viewportLines, visualLineAt, scrollPosIntoView, scrollTo, and centerOn were removed from the library.

All decorations are now provided through EditorView.decorations, and are part of a single precedence ordering. Decoration sources that need access to the view are provided as functions.

Atomic ranges are now specified through a facet (EditorView.atomicRanges).

Scroll margins are now specified through a facet (EditorView.scrollMargins).

Plugin fields no longer exist in the library (and are replaced by facets holding function values).

This package no longer re-exports the Range type from @codemirror/state.

Bug fixes

Fix a bug where zero-length block widgets could cause viewportLineBlocks to contain overlapping ranges.

New features

The new perLineTextDirection facet configures whether the editor reads text direction per line, or uses a single direction for the entire editor. EditorView.textDirectionAt returns the direction around a given position.

rectangularSelection and crosshairCursor from @codemirror/rectangular-selection were merged into this package.

This package now exports the tooltip functionality that used to live in @codemirror/tooltip.

The exports from the old @codemirror/panel package are now available from this package.

The exports from the old @codemirror/gutter package are now available from this package.

@codemirror/language 0.20.0 (2022-04-20)

Breaking changes

HighlightStyle.get is now called highlightingFor.

HighlightStyles no longer function as extensions (to improve tree shaking), and must be wrapped with syntaxHighlighting to add to an editor configuration.

Language objects no longer have a topNode property.

New features

HighlightStyle and defaultHighlightStyle from the now-removed @codemirror/highlight package now live in this package.

The new forceParsing function can be used to run the parser forward on an editor view.

The exports that used to live in @codemirror/matchbrackets are now exported from this package.

The @codemirror/fold package has been merged into this one.

The exports from the old @codemirror/stream-parser package now live in this package.

@codemirror/commands 0.20.0 (2022-04-20)

Breaking changes

There is no longer a separate commentKeymap. Those bindings are now part of defaultKeymap.

Bug fixes

Make cursorPageUp and cursorPageDown move by window height when the editor is higher than the window.

Make sure the default behavior of Home/End is prevented, since it could produce unexpected results on macOS.

New features

The exports from @codemirror/comment are now available in this package.

The exports from the @codemirror/history package are now available from this package.

@codemirror/search 0.20.0 (2022-04-20)

Bug fixes

Make the wholeWords option to highlightSelectionMatches default to false, as intended.

@codemirror/autocomplete 0.20.0 (2022-04-20)

Breaking changes

CompletionResult.span has been renamed to validFor, and may now hold a function as well as a regular expression.

Bug fixes

Remove code that dropped any options beyond the 300th one when matching and sorting option lists.

Completion will now apply to all cursors when there are multiple cursors.

New features

CompletionResult.update can now be used to implement quick autocompletion updates in a synchronous way.

The @codemirror/closebrackets package was merged into this one.

@codemirror/lint 0.20.0 (2022-04-20)

Breaking changes

Update dependencies to 0.20.0

@codemirror/collab 0.20.0 (2022-04-20)

Breaking changes

Update dependencies to 0.20.0

@codemirror/language-data 0.20.0 (2022-04-20)

Breaking changes

Update dependencies to 0.20.0

codemirror 0.20.0 (2022-04-20)

Breaking changes

Update dependencies to 0.20.0

@codemirror/search 0.19.10 (2022-04-04)

Bug fixes

Make sure search matches are highlighted when scrolling new content into view.

@codemirror/language 0.19.10 (2022-03-31)

Bug fixes

Autocompletion may now also trigger automatic indentation on input.

@codemirror/view 0.19.48 (2022-03-30)

Bug fixes

Fix an issue where DOM syncing could crash when a DOM node was moved from a parent to a child node (via widgets reusing existing nodes).

To avoid interfering with things like a vim mode too much, the editor will now only activate the tab-to-move-focus escape hatch after an escape press that wasn't handled by an event handler.

Make sure the view measures itself before the page is printed.

Tweak types of view plugin defining functions to avoid TypeScript errors when the plugin value doesn't have any of the interface's properties.

@codemirror/language 0.19.9 (2022-03-30)

Bug fixes

Make sure nodes that end at the end of a partial parse aren't treated as valid fold targets.

Fix an issue where the parser sometimes wouldn't reuse parsing work done in the background on transactions.

codemirror 0.19.3 (2022-03-30)

New features

Add the extension that shows a crosshair cursor when Alt is held down to the basic setup.

@codemirror/autocomplete 0.19.15 (2022-03-23)

New features

The selectedCompletionIndex function tells you the position of the currently selected completion.

The new setSelectionCompletion function creates a state effect that moves the selected completion to a given index.

A completion's info method may now return null to indicate that no further info is available.

@codemirror/autocomplete 0.19.14 (2022-03-10)

Bug fixes

Make the ARIA attributes added to the editor during autocompletion spec-compliant.

@codemirror/view 0.19.47 (2022-03-08)

Bug fixes

Fix an issue where block widgets at the start of the viewport could break height computations.

@codemirror/lint 0.19.6 (2022-03-04)

Bug fixes

Fix a bug where hovering over the icons in the lint gutter would sometimes fail to show a tooltip or show the tooltip for another line.

@codemirror/view 0.19.46 (2022-03-03)

Bug fixes

Fix a bug where block widgets on the edges of viewports could cause the positioning of content to misalign with the gutter and height computations.

Improve cursor height next to widgets.

Fix a bug where mapping positions to screen coordinates could return incorred coordinates during composition.

@codemirror/language 0.19.8 (2022-03-03)

Bug fixes

Fix an issue that could cause indentation logic to use the wrong line content when indenting multiple lines at once.

@codemirror/search 0.19.9 (2022-03-03)

New features

The selection-matching extension now accepts a wholeWords option that makes it only highlight matches that span a whole word. Add SearchQuery.getCursor

The SearchQuery class now has a getCursor method that allows external code to create a cursor for the query.

@codemirror/lint 0.19.5 (2022-02-25)

Bug fixes

Make sure the lint gutter tooltips are positioned under their icon, even when the line is wrapped.

@codemirror/lint 0.19.4 (2022-02-25)

Bug fixes

Fix an issue where an outdated marker could stick around on the lint gutter after all diagnostics were removed.

New features

Add a hoverTime option to the lint gutter. Change default hover time to 300

@codemirror/view 0.19.45 (2022-02-23)

Bug fixes

Fix an issue where the library failed to call WidgetType.destroy on the old widget when replacing a widget with a different widget of the same type.

Fix an issue where the editor would compute DOM positions inside composition contexts incorrectly in some cases, causing the selection to be put in the wrong place and needlessly interrupting compositions.

Fix leaking of resize event handlers.

@codemirror/autocomplete 0.19.13 (2022-02-18)

Bug fixes

Fix an issue where the completion tooltip stayed open if it was explicitly opened and the user backspaced past its start.

Stop snippet filling when a change happens across one of the snippet fields' boundaries.

@codemirror/view 0.19.44 (2022-02-17)

Bug fixes

Fix a crash that occasionally occurred when drag-selecting in a way that scrolled the editor.

New features

The new EditorView.compositionStarted property indicates whether a composition is starting.

@codemirror/state 0.19.9 (2022-02-16)

Bug fixes

Mapping a non-empty selection range now always puts any newly inserted text on the sides of the range outside of the mapped version.

@codemirror/view 0.19.43 (2022-02-16)

Bug fixes

Fix several issues where editing or composition went wrong due to our zero-width space kludge characters ending up in unexpected places.

Make sure the editor re-measures its dimensions whenever its theme changes.

Fix an issue where some keys on Android phones could leave the editor DOM unsynced with the actual document.

@codemirror/state 0.19.8 (2022-02-15)

Bug fixes

Fix a bug where facet values with computed inputs could incorrectly retain their old value on reconfiguration.

@codemirror/language-data 0.19.2 (2022-02-15)

@codemirror/search 0.19.8 (2022-02-14)

Bug fixes

Fix a bug that caused the search panel to start open when configuring a state with the search() extension.

@codemirror/search 0.19.7 (2022-02-14)

Breaking changes

searchConfig is deprecated in favor of search (but will exist until next major release).

New features

The new search function is now used to enable and configure the search extension.

@codemirror/state 0.19.7 (2022-02-11)

Bug fixes

Avoid recomputing facets on state reconfiguration if that facet's inputs stayed precisely the same.

Selection ranges created with EditorSelection.range will now have an assoc pointing at their anchor, when non-empty.

@codemirror/view 0.19.42 (2022-02-05)

Bug fixes

Fix a regression in cursor position determination after making an edit next to a widget.

@codemirror/view 0.19.41 (2022-02-04)

Bug fixes

Fix an issue where the editor's view of its content height could go out of sync with the DOM when a line-wrapping editor had its width changed, causing wrapping to change.

Fix a bug that caused the editor to draw way too much content when scrolling to a position in an editor (much) taller than the window.

Report an error when a replace decoration from a plugin crosses a line break, rather than silently ignoring it.

Fix an issue where reading DOM changes was broken when lineSeparator contained more than one character.

Make ordering of replace and mark decorations with the same extent and inclusivness more predictable by giving replace decorations precedence.

Fix a bug where, on Chrome, replacement across line boundaries and next to widgets could cause bogus zero-width characters to appear in the content.

@codemirror/search 0.19.6 (2022-01-27)

Bug fixes

Make selectNextOccurrence scroll the newly selected range into view.

@codemirror/commands 0.19.8 (2022-01-26)

Bug fixes

deleteCharBackward now removes extending characters one at a time, rather than deleting the entire glyph at once.

Alt-v is no longer bound in emacsStyleKeymap and macOS's standardKeymap, because macOS doesn't bind it by default and it conflicts with some keyboard layouts.

@codemirror/view 0.19.40 (2022-01-19)

Bug fixes

Make composition input properly appear at secondary cursors (except when those are in the DOM node with the composition, in which case the browser won't allow us to intervene without aborting the composition).

Fix a bug that cause the editor to get confused about which content was visible after scrolling something into view.

Fix a bug where the dummy elements rendered around widgets could end up in a separate set of wrapping marks, and thus become visible.

EditorView.moveVertically now preserves the assoc property of the input range.

Get rid of gaps between selection elements drawn by drawSelection.

Fix an issue where replacing text next to a widget might leak bogus zero-width spaces into the document.

Avoid browser selection mishandling when a focused view has setState called by eagerly refocusing it.

@codemirror/commands 0.19.7 (2022-01-11)

Bug fixes

Don't bind Alt-< and Alt-> on macOS by default, since those interfere with some keyboard layouts. Make cursorPageUp/Down scroll the view to keep the cursor in place

cursorPageUp and cursorPageDown now scroll the view by the amount that the cursor moved.

@codemirror/autocomplete 0.19.12 (2022-01-11)

Bug fixes

Fix completion navigation with PageUp/Down when the completion tooltip isn't part of the view DOM.

@codemirror/autocomplete 0.19.11 (2022-01-11)

Bug fixes

Fix a bug that caused page up/down to only move the selection by two options in the completion tooltip.

@codemirror/view 0.19.39 (2022-01-06)

Bug fixes

Make sure the editor signals a geometryChanged update when its width changes.

New features

EditorView.darkTheme can now be queried to figure out whether the editor is using a dark theme.

@codemirror/view 0.19.38 (2022-01-05)

Bug fixes

Fix a bug that caused line decorations with a class property to suppress all other line decorations for that line.

Fix a bug that caused scroll effects to be corrupted when further updates came in before they were applied.

Fix an issue where, depending on which way a floating point rounding error fell, posAtCoords (and thus vertical cursor motion) for positions outside of the vertical range of the document might or might not return the start/end of the document.

@codemirror/autocomplete 0.19.10 (2022-01-05)

Bug fixes

Make sure the info tooltip is hidden when the selected option is scrolled out of view.

Fix a bug in the completion ranking that would sometimes give options that match the input by word start chars higher scores than appropriate.

Options are now sorted (ascending) by length when their match score is otherwise identical.

@codemirror/view 0.19.37 (2021-12-22)

Bug fixes

Fix regression where plugin replacing decorations that span to the end of the line are ignored.

@codemirror/view 0.19.36 (2021-12-22)

Bug fixes

Fix a crash in posAtCoords when the position lies in a block widget that is rendered but scrolled out of view.

Adding block decorations from a plugin now raises an error. Replacing decorations that cross lines are ignored, when provided by a plugin.

Fix inverted interpretation of the precise argument to posAtCoords.

@codemirror/view 0.19.35 (2021-12-20)

Bug fixes

The editor will now handle double-taps as if they are double-clicks, rather than letting the browser's native behavior happen (because the latter often does the wrong thing).

Fix an issue where backspacing out a selection on Chrome Android would sometimes only delete the last character due to event order issues.

posAtCoords, without second argument, will no longer return null for positions below or above the document.

@codemirror/view 0.19.34 (2021-12-17)

Bug fixes

Fix a bug where content line elements would in some cases lose their cm-line class.

@codemirror/view 0.19.33 (2021-12-16)

Breaking changes

EditorView.scrollTo and EditorView.centerOn are deprecated in favor of EditorView.scrollIntoView, and will be removed in the next breaking release.

Bug fixes

Fix an issue that could cause the editor to unnecessarily interfere with composition (especially visible on macOS Chrome).

A composition started with multiple lines selected will no longer be interruptd by the editor.

New features

The new EditorView.scrollIntoView function allows you to do more fine-grained scrolling.

@codemirror/search 0.19.5 (2021-12-16)

Breaking changes

The search option matchCase was renamed to caseSensitive (the old name will continue to work until the next breaking release).

Bug fixes

openSearchPanel will now update the search query to the current selection even if the panel was already open.

New features

Client code can now pass a custom search panel creation function in the search configuration.

The getSearchQuery function and setSearchQuery effect can now be used to inspect or change the current search query.

@codemirror/view 0.19.32 (2021-12-15)

Bug fixes

Fix a bug where CodeMirror's own event handers would run even after a user-supplied handler called preventDefault on an event.

Properly draw selections when negative text-indent is used for soft wrapping.

Fix an issue where viewportLineBlocks could hold inaccurate height information when the vertical scaling changed.

Fixes drop cursor positioning when the document is scrolled. Force a content measure when the editor comes into view

Fix a bug that could cause the editor to not measure its layout the first time it came into view.

@codemirror/view 0.19.31 (2021-12-13)

New features

The package now exports a dropCursor extension that draws a cursor at the current drop position when dragging content over the editor.

@codemirror/view 0.19.30 (2021-12-13)

Bug fixes

Refine Android key event handling to work properly in a GBoard corner case where pressing Enter fires a bunch of spurious deleteContentBackward events.

Fix a crash in drawSelection for some kinds of selections.

Prevent a possibility where some content updates causes duplicate text to remain in DOM.

New features

Support a maxLength option to MatchDecorator that allows user code to control how far it scans into hidden parts of viewport lines.

codemirror 0.19.1 (2021-12-13)

New features

The basic setup now includes the dropCursor extension.

@codemirror/commands 0.19.6 (2021-12-10)

Bug fixes

The standard keymap no longer overrides Shift-Delete, in order to allow the native behavior of that key to happen on platforms that support it.

@codemirror/view 0.19.29 (2021-12-09)

Bug fixes

Fix a bug that could cause out-of-view editors to get a nonsensical viewport and fail to scroll into view when asked to.

Fix a bug where would return 0 when clicking below the content if the last line was replaced with a block widget decoration.

Fix an issue where clicking at the position of the previous cursor in a blurred editor would cause the selection to reset to the start of the document.

Fix an issue where composition could be interrupted if the browser created a new node inside a mark decoration node.

@codemirror/view 0.19.28 (2021-12-08)

Bug fixes

Fix an issue where pressing Enter on Chrome Android during composition did not fire key handlers for Enter.

Avoid a Chrome bug where the virtual keyboard closes when pressing backspace after a widget.

Fix an issue where the editor could show a horizontal scroll bar even after all lines that caused it had been deleted or changed.

@codemirror/view 0.19.27 (2021-12-06)

Bug fixes

Fix a bug that could cause EditorView.plugin to inappropriately return null during plugin initialization.

Fix a bug where a block widget without estimatedHeight at the end of the document could fail to be drawn

@codemirror/view 0.19.26 (2021-12-03)

New features

Widgets can now define a destroy method that is called when they are removed from the view.

@codemirror/view 0.19.25 (2021-12-02)

Bug fixes

Widgets around replaced ranges are now visible when their side does not point towards the replaced range.

A replaced line with a line decoration no longer creates an extra empty line block in the editor.

The scrollPastEnd extension will now over-reserve space at the bottom of the editor on startup, to prevent restored scroll positions from being clipped.

New features

EditorView.editorAttributes and contentAttributes may now hold functions that produce the attributes.

@codemirror/language 0.19.7 (2021-12-02)

Bug fixes

Fix an issue where the parse worker could incorrectly stop working when the parse tree has skipped gaps in it.

@codemirror/search 0.19.4 (2021-12-02)

Bug fixes

The search panel will no longer show the replace interface when the editor is read-only.

@codemirror/view 0.19.24 (2021-12-01)

Bug fixes

Fix a bug where lineBlockAt, for queries inside the viewport, would always return the first line in the viewport.

@codemirror/view 0.19.23 (2021-11-30)

Bug fixes

Fix an issue where after some kinds of changes, EditorView.viewportLineBlocks held an out-of-date set of blocks.

New features

Export EditorView.documentPadding, with information about the vertical padding of the document.

@codemirror/view 0.19.22 (2021-11-30)

Bug fixes

Fix an issue where editors with large vertical padding (for example via scrollPastEnd) could sometimes lose their scroll position on Chrome.

Avoid some unnecessary DOM measuring work by more carefully checking whether it is needed.

New features

The new elementAtHeight, lineBlockAtHeight, and lineBlockAt methods provide a simpler and more efficient replacement for the (now deprecated) blockAtHeight, visualLineAtHeight, and visualLineAt methods.

The editor view now exports a documentTop getter that gives you the vertical position of the top of the document. All height info is queried and reported relative to this top.

The editor view's new viewportLineBlocks property provides an array of in-viewport line blocks, and replaces the (now deprecated) viewportLines method.

@codemirror/view 0.19.21 (2021-11-26)

Bug fixes

Fix a problem where the DOM update would unnecessarily trigger browser relayouts.

@codemirror/language 0.19.6 (2021-11-26)

Bug fixes

Fixes an issue where the background parse work would be scheduled too aggressively, degrading responsiveness on a newly-created editor with a large document.

Improve initial highlight for mixed-language editors and limit the amount of parsing done on state creation for faster startup.

@codemirror/autocomplete 0.19.9 (2021-11-26)

Bug fixes

Fix an issue where info tooltips would be visible in an inappropriate position when there was no room to place them properly.

@codemirror/search 0.19.3 (2021-11-22)

Bug fixes

Add userEvent annotations to search and replace transactions.

Make sure the editor handles keys bound to findNext/findPrevious even when there are no matches, to avoid the browser's search interrupting users.

New features

Add a Symbol.iterator property to the cursor types, so that they can be used with for/of.

@codemirror/state 0.19.6 (2021-11-19)

Bug fixes

Fix a bug that caused facet compare functions to be called with an invalid value in some situations.

Fix a bug that caused dynamic facet values to be incorrectly kept unchanged when reconfiguration changed one of their dependencies.

@codemirror/view 0.19.20 (2021-11-19)

Bug fixes

Run a measure cycle when the editor's size spontaneously changes.

@codemirror/view 0.19.19 (2021-11-17)

Bug fixes

Fix a bug that caused the precedence of editorAttributes and contentAttributes to be inverted, making lower-precedence extensions override higher-precedence ones.

@codemirror/language 0.19.5 (2021-11-17)

New features

The new function syntaxTreeAvailable can be used to check if a fully-parsed syntax tree is available up to a given document position.

The module now exports syntaxParserRunning, which tells you whether the background parser is still planning to do more work for a given editor view.

@codemirror/autocomplete 0.19.8 (2021-11-17)

Bug fixes

Give the completion tooltip a minimal width, and show ellipsis when completions overflow the tooltip width.

New features

autocompletion now accepts an aboveCursor option to make the completion tooltip show up above the cursor.

@codemirror/view 0.19.18 (2021-11-16)

Bug fixes

Fix an issue where the editor wasn't aware it was line-wrapping with its own lineWrapping extension enabled.

@codemirror/view 0.19.17 (2021-11-16)

Bug fixes

Avoid an issue where stretches of whitespace on line wrap points could cause the cursor to be placed outside of the content.

@codemirror/autocomplete 0.19.7 (2021-11-16)

Bug fixes

Make option deduplication less aggressive, so that options with different type or apply fields don't get merged.

@codemirror/language 0.19.4 (2021-11-13)

New features

LanguageDescription.of now takes an optional already-loaded extension.

@codemirror/autocomplete 0.19.6 (2021-11-12)

Bug fixes

Fix an issue where parsing a snippet with a field that was labeled only by a number crashed.

@codemirror/view 0.19.16 (2021-11-11)

Breaking changes

Block replacement decorations now default to inclusive, because non-inclusive block decorations are rarely what you need.

Bug fixes

Fix an issue that caused block widgets to always have a large side value, making it impossible to show them between to replacement decorations.

Fix a crash that could happen after some types of viewport changes, due to a bug in the block widget view data structure.

@codemirror/state 0.19.5 (2021-11-10)

Bug fixes

Fix a bug that would cause dynamic facet values influenced by a state reconfiguration to not properly recompute.

@codemirror/view 0.19.15 (2021-11-09)

Bug fixes

Fix a bug where the editor would think it was invisible when the document body was given screen height and scroll behavior.

Fix selection reading inside a shadow root on iOS.

@codemirror/autocomplete 0.19.5 (2021-11-09)

Bug fixes

Make sure info tooltips don't stick out of the bottom of the page.

New features

The package exports a new function selectedCompletion, which can be used to find out which completion is currently selected.

Transactions created by picking a completion now have an annotation (pickedCompletion) holding the original completion.

@codemirror/lint 0.19.3 (2021-11-09)

New features

Export a function lintGutter which returns an extension that installs a gutter marking lines with diagnostics.

The package now exports the effect used to update the diagnostics (setDiagnosticsEffect).

@codemirror/view 0.19.14 (2021-11-07)

Bug fixes

Fix an issue where typing into a read-only editor would move the selection.

Fix slowness when backspace is held down on iOS.

@codemirror/view 0.19.13 (2021-11-06)

Bug fixes

Fix a bug where backspace, enter, and delete would get applied twice on iOS.

@codemirror/state 0.19.4 (2021-11-05)

Bug fixes

When reconfiguring a state, effects from the reconfiguring transaction can now be seen by newly added state fields.

@codemirror/view 0.19.12 (2021-11-04)

Bug fixes

Make sure the workaround for the lost virtual keyboard on Chrome Android also works on slower phones. Slight style change in beforeinput handler

Avoid failure cases in viewport-based rendering of very long lines.

@codemirror/state 0.19.3 (2021-11-03)

New features

The precedence levels (under Prec) now have more generic names, because their 'meaningful' names were entirely inappropriate in many situations.

@codemirror/view 0.19.11 (2021-11-03)

Breaking changes

EditorView.scrollPosIntoView has been deprecated. Use the EditorView.scrollTo effect instead.

New features

The new EditorView.centerOn effect can be used to scroll a given range to the center of the view.

@codemirror/view 0.19.10 (2021-11-02)

Bug fixes

Don't crash when IntersectionObserver fires its callback without any records. Try to handle some backspace issues on Chrome Android

Using backspace near uneditable widgets on Chrome Android should now be more reliable.

Work around a number of browser bugs by always rendering zero-width spaces around in-content widgets, so that browsers will treat the positions near them as valid cursor positions and not try to run composition across widget boundaries.

Work around bogus composition changes created by Chrome Android after handled backspace presses.

Work around an issue where tapping on an uneditable node in the editor would sometimes fail to show the virtual keyboard on Chrome Android.

Prevent translation services from translating the editor content. Show direction override characters as special chars by default

specialChars will now, by default, replace direction override chars, to mitigate attacks.

New features

The editor view will, if parent is given but root is not, derive the root from the parent element.

Line decorations now accept a class property to directly add DOM classes to the line.

@codemirror/autocomplete 0.19.4 (2021-10-24)

Bug fixes

Don't rely on the platform's highlight colors for the active completion, since those are inconsistent and may not be appropriate for the theme.

Fix incorrect match underline for some kinds of matched completions.

@codemirror/language-data 0.19.1 (2021-10-19)

New features

Support Lezer-based PHP and WAST modes.

@codemirror/view 0.19.9 (2021-10-01)

Bug fixes

Fix an issue where some kinds of reflows in the surrounding document could move unrendered parts of the editor into view without the editor noticing and updating its viewport.

Fix an occasional crash in the selection drawing extension.

@codemirror/lint 0.19.2 (2021-09-29)

Bug fixes

Fix a bug where reconfiguring the lint source didn't restart linting.

@codemirror/view 0.19.8 (2021-09-26)

Bug fixes

Fix a bug that could, on DOM changes near block widgets, insert superfluous line breaks.

Make interacting with a destroyed editor view do nothing, rather than crash, to avoid tripping people up with pending timeouts and such.

Make sure ViewUpdate.viewportChanged is true whenever visibleRanges changes, so that plugins acting only on visible ranges can use it to check when to update.

Fix line-wise cut on empty lines.

@codemirror/commands 0.19.5 (2021-09-21)

New features

Adds an insertBlankLine command which creates an empty line below the selection, and binds it to Mod-Enter in the default keymap.

@codemirror/lint 0.19.1 (2021-09-17)

Bug fixes

Prevent decorations that cover just a line break from being invisible by showing a widget instead of range for them.

New features

The diagnosticCount method can now be used to determine whether there are active diagnostics.

@codemirror/search 0.19.2 (2021-09-16)

Bug fixes

selectNextOccurrence will now only select partial words if the current main selection hold a partial word.

Explicitly set the button's type to prevent the browser from submitting forms wrapped around the editor.

@codemirror/state 0.19.2 (2021-09-13)

New features

The editor state now has a readOnly property with a matching facet to control its value.

@codemirror/view 0.19.7 (2021-09-13)

Bug fixes

The view is now aware of the new EditorState.readOnly property, and suppresses events that modify the document when it is true.

@codemirror/language 0.19.3 (2021-09-13)

Bug fixes

Fix an issue where a parse that skipped content with skipUntilInView would in some cases not be restarted when the range came into view.

@codemirror/commands 0.19.4 (2021-09-13)

Bug fixes

Make commands that affect the editor's content check state.readOnly and return false when that is true.

@codemirror/view 0.19.6 (2021-09-10)

Bug fixes

Remove a console.log that slipped into the previous release.

@codemirror/view 0.19.5 (2021-09-09)

New features

The new EditorView.scrollTo effect can be used to scroll a given range into view.

@codemirror/commands 0.19.3 (2021-09-09)

Bug fixes

Make by-line cursor motion commands move the cursor to the start/end of the document when they hit the first/last line.

Fix a bug where deleteCharForward/Backward behaved incorrectly when deleting directly before or after an atomic range.

@codemirror/search 0.19.1 (2021-09-06)

Bug fixes

Make highlightSelectionMatches not produce overlapping decorations, since those tend to just get unreadable.

Make sure any existing search text is selected when opening the search panel. Add search config option to not match case when search panel is opened (#4)

New features

The searchConfig function now takes a matchCase option that controls whether the search panel starts in case-sensitive mode.

@codemirror/view 0.19.4 (2021-09-01)

Bug fixes

Fix an issue where lines containing just a widget decoration wrapped in a mark decoration could be displayed with 0 height.

@codemirror/autocomplete 0.19.3 (2021-08-31)

Bug fixes

Improve the sorting of completions by using localeCompare.

Fix reading of autocompletions in NVDA screen reader.

New features

The new icons option can be used to turn off icons in the completion list.

The optionClass option can now be used to add CSS classes to the options in the completion list.

It is now possible to inject additional content into rendered completion options with the addToOptions configuration option.

@codemirror/view 0.19.3 (2021-08-25)

Bug fixes

Fix a view corruption that could happen in situations involving overlapping mark decorations.

@codemirror/autocomplete 0.19.2 (2021-08-25)

Bug fixes

Fix an issue where completeAnyWord would return results when there was no query and explicit was false.

@codemirror/commands 0.19.2 (2021-08-24)

New features

New commands cursorSubwordForward, cursorSubwordBackward, selectSubwordForward, and selectSubwordBackward which implement motion by camel case subword.

@codemirror/view 0.19.2 (2021-08-23)

New features

The package now exports a scrollPastEnd function, which returns an extension that adds space below the document to allow the last line to be scrolled to the top of the editor.

@codemirror/state 0.19.1 (2021-08-15)

Bug fixes

Fix a bug where wordAt never returned a useful result.

@codemirror/state 0.19.0 (2021-08-11)

Breaking changes

User event strings now work differently—the events emitted by the core packages follow a different system, and hierarchical event tags can be created by separating the words with dots.

New features

languageDataAt now takes an optional side argument to specificy which side of the position you're interested in.

It is now possible to add a user event annotation with a direct userEvent property on a transaction spec.

Transactions now have an isUserEvent method that can be used to check if it is (a subtype of) some user event type.

@codemirror/view 0.19.1 (2021-08-11)

Breaking changes

The view now emits new-style user event annotations for the transactions it generates.

Bug fixes

Fix a bug where coordsAtPos would allow the passed side argument to override widget sides, producing incorrect cursor positions.

Fix a bug that could cause content lines to be misaligned in certain situations involving widgets at the end of lines.

Fix an issue where, if the browser decided to modify DOM attributes in the content in response to some editing action, the view failed to reset those again.

@codemirror/language 0.19.2 (2021-08-11)

Bug fixes

Fix a bug that caused indentOnInput to fire for the wrong kinds of transactions.

Fix a bug that could cause indentOnInput to apply its changes incorrectly.

@codemirror/language 0.19.1 (2021-08-11)

Bug fixes

Fix incorrect versions for @lezer dependencies.

@codemirror/language 0.19.0 (2021-08-11)

Breaking changes

CodeMirror now uses lezer 0.15, which means different package names (scoped with @lezer) and some breaking changes in the library.

EditorParseContext is now called ParseContext. It is no longer passed to parsers, but must be retrieved with ParseContext.get.

IndentContext.lineIndent now takes a position, not a Line object, as argument.

LezerLanguage was renamed to LRLanguage (because all languages must emit Lezer-style trees, the name was misleading).

Language.parseString no longer exists. You can just call .parser.parse(...) instead.

New features

New IndentContext.lineAt method to access lines in a way that is aware of simulated line breaks.

IndentContext now provides a simulatedBreak property through which client code can query whether the context has a simulated line break.

@codemirror/commands 0.19.1 (2021-08-11)

Bug fixes

Fix incorrect versions for @lezer dependencies.

@codemirror/commands 0.19.0 (2021-08-11)

Breaking changes

Change default binding for backspace to deleteCharBackward, drop deleteCodePointBackward/Forward from the library.

defaultTabBinding was removed.

Bug fixes

Drop Alt-d, Alt-f, and Alt-b bindings from emacsStyleKeymap (and thus from the default macOS bindings).

deleteCharBackward and deleteCharForward now take atomic ranges into account.

New features

Attach more granular user event strings to transactions.

The module exports a new binding indentWithTab that binds tab and shift-tab to indentMore and indentLess.

@codemirror/search 0.19.0 (2021-08-11)

Bug fixes

Make sure to prevent the native Mod-d behavior so that the editor doesn't lose focus after selecting past the last occurrence.

@codemirror/autocomplete 0.19.1 (2021-08-11)

Bug fixes

Fix incorrect versions for @lezer dependencies.

@codemirror/autocomplete 0.19.0 (2021-08-11)

Breaking changes

Update dependencies to 0.19.0

@codemirror/lint 0.19.0 (2021-08-11)

Breaking changes

Update dependencies to 0.19.0

@codemirror/collab 0.19.0 (2021-08-11)

Breaking changes

Update dependencies to 0.19.0

@codemirror/language-data 0.19.0 (2021-08-11)

Breaking changes

Update dependencies to 0.19.0

codemirror 0.19.0 (2021-08-11)

Breaking changes

Update dependencies to 0.19.0

@codemirror/lint 0.18.6 (2021-08-08)

Bug fixes

Fix a crash in the key handler of the lint panel when no diagnostics are available.

@codemirror/lint 0.18.5 (2021-08-07)

Bug fixes

Fix an issue that caused openLintPanel to not actually open the panel when ran before the editor had any lint state loaded.

New features

The package now exports a forceLinting function that forces pending lint queries to run immediately.

@codemirror/view 0.18.19 (2021-07-12)

Bug fixes

Fix a regression where EditorView.editable.of(false) didn't disable editing on Webkit-based browsers.

@codemirror/view 0.18.18 (2021-07-06)

Bug fixes

Fix a bug that caused EditorView.moveVertically to only move by one line, even when given a custom distance, in some cases.

Hide Safari's native bold/italic/underline controls for the content.

Fix a CSS problem that prevented Safari from breaking words longer than the line in line-wrapping mode.

Avoid a problem where composition would be inappropriately abored on Safari.

Fix drag-selection that scrolls the content by dragging past the visible viewport.

New features

posAtCoords now has an imprecise mode where it'll return an approximate position even for parts of the document that aren't currently rendered.

@codemirror/autocomplete 0.18.8 (2021-06-30)

New features

Add an ifIn helper function that constrains a completion source to only fire when in a given syntax node. Add support for unfiltered completions

A completion result can now set a filter: false property to disable filtering and sorting of completions, when it already did so itself.

@codemirror/view 0.18.17 (2021-06-14)

Bug fixes

Make drawSelection behave properly when lines are split by block widgets.

Make sure drawn selections that span a single line break don't leave a gap between the lines.

@codemirror/autocomplete 0.18.7 (2021-06-14)

Bug fixes

Don't treat continued completions when typing after an explicit completion as explicit.

@codemirror/commands 0.18.3 (2021-06-11)

Bug fixes

moveLineDown will no longer incorrectly grow the selection.

Line-based commands will no longer include lines where a range selection ends right at the start of the line.

@codemirror/lint 0.18.4 (2021-06-07)

Bug fixes

Multiple linter extensions can now be added to an editor without disrupting each other.

Fix poor layout on lint tooltips due to changes in @codemirror/tooltip.

@codemirror/view 0.18.16 (2021-06-03)

Bug fixes

Fix a crash that could occur when the document changed during mouse selection.

Fix a bug where composition inside styled content would sometimes be inappropriately aborted by editor DOM updates.

New features

MouseSelectionStyle.update may now return true to indicate it should be queried for a new selection after the update.

@codemirror/autocomplete 0.18.6 (2021-06-03)

Bug fixes

Adding or reconfiguring completion sources will now cause them to be activated right away if a completion was active.

New features

You can now specify multiple types in Completion.type by separating them by spaces. Small doc comment tweak for Completion.type

@codemirror/view 0.18.15 (2021-06-01)

Bug fixes

Fix a bug that would, in very specific circumstances, cause posAtCoords to go into an infinite loop in Safari.

Fix a bug where some types of IME input on Mobile Safari would drop text.

@codemirror/language 0.18.2 (2021-06-01)

Bug fixes

Fix an issue where asynchronous re-parsing (with dynamically loaded languages) sometimes failed to fully happen.

@codemirror/view 0.18.14 (2021-05-28)

Bug fixes

Fix an issue where the DOM selection was sometimes not properly updated when next to a widget.

Invert the order in which overlapping decorations are drawn so that higher-precedence decorations are nested inside lower-precedence ones (and thus override their styling).

Fix a but in posAtCoords where it would in some situations return -1 instead of null.

New features

A new plugin field, PluginField.atomicRanges, can be used to cause cursor motion to skip past some ranges of the document.

@codemirror/search 0.18.4 (2021-05-27)

New features

Initialize the search query to the current selection, when there is one, when opening the search dialog.

Add a searchConfig function, supporting an option to put the search panel at the top of the editor.

codemirror 0.18.2 (2021-05-25)

Bug fixes

Fix too-low dependency on @codemirror/gutter that could cause broken upgrades.

@codemirror/view 0.18.13 (2021-05-20)

Bug fixes

Fix a bug that would cause the content DOM update to crash in specific circumstances.

Work around an issue where, after some types of changes, Mobile Safari would ignore Enter presses.

Make iOS enter and backspace handling more robust, so that platform bugs are less likely to break those keys in the editor.

Fix a regression where Esc + Tab no longer allowed the user to exit the editor.

New features

You can now drop text files into the editor.

@codemirror/search 0.18.3 (2021-05-18)

Bug fixes

Fix a bug where the first search command in a new editor wouldn't properly open the panel.

New features

New command selectNextOccurrence that selects the next occurrence of the selected word (bound to Mod-d in the search keymap).

codemirror 0.18.1 (2021-05-15)

New features

The basic setup now includes highlightActiveLineGutter from @codemirror/gutter.

@codemirror/view 0.18.12 (2021-05-10)

Bug fixes

Work around a Mobile Safari bug where, after backspacing out the last character on a line, Enter didn't work anymore.

Work around a problem in Mobile Safari where you couldn't tap to put the cursor at the end of a line that ended in a widget.

@codemirror/lint 0.18.3 (2021-05-10)

Bug fixes

Fix a regression where using setDiagnostics when linting hadn't been abled yet ignored the first set of diagnostics.

@codemirror/commands 0.18.2 (2021-05-06)

Bug fixes

Use Ctrl-l, not Alt-l, to bind selectLine on macOS, to avoid conflicting with special-character-insertion bindings.

Make the macOS Command-ArrowLeft/Right commands behave more like their native versions.

@codemirror/state 0.18.7 (2021-05-04)

Bug fixes

Fix an issue where state fields might be initialized with a state that they aren't actually part of during reconfiguration.

@codemirror/view 0.18.11 (2021-04-30)

Bug fixes

Add an attribute to prevent the Grammarly browser extension from messing with the editor content.

Fix more issues around selection handling a Shadow DOM in Safari.

@codemirror/view 0.18.10 (2021-04-27)

Bug fixes

Fix a bug where some types of updates wouldn't properly cause marks around the changes to be joined in the DOM.

Fix an issue where the content and gutters in a fixed-height editor could be smaller than the editor height.

Fix a crash on Safari when initializing an editor in an unfocused window.

Fix a bug where the editor would incorrectly conclude it was out of view in some types of absolutely positioned parent elements.

@codemirror/view 0.18.9 (2021-04-23)

Bug fixes

Fix a crash that occurred when determining DOM coordinates in some specific situations.

Fix a crash when a DOM change that ended at a zero-width view element (widget) removed that element from the DOM.

Disable autocorrect and autocapitalize by default, since in most code-editor contexts they get in the way. You can use EditorView.contentAttributes to override this.

Fix a bug that interfered with native touch selection handling on Android.

Fix an unnecessary DOM update after composition that would disrupt touch selection on Android.

Add a workaround for Safari's broken selection reporting when the editor is in a shadow DOM tree.

Fix select-all from the context menu on Safari.

@codemirror/autocomplete 0.18.5 (2021-04-23)

Bug fixes

Fix a regression where snippet field selection didn't work with @codemirror/state 0.18.6.

Fix a bug where snippet fields with different position numbers were inappropriately merged.

@codemirror/autocomplete 0.18.4 (2021-04-20)

Bug fixes

Fix a crash in Safari when moving the selection during composition.

@codemirror/view 0.18.8 (2021-04-19)

Bug fixes

Handle selection replacements where the inserted text matches the start/end of the replaced text better.

Fix an issue where the editor would miss scroll events when it was placed in a DOM component slot.

@codemirror/lint 0.18.2 (2021-04-16)

Bug fixes

Newlines in line messages are now shown as line breaks to the user.

New features

You can now pass a delay option to linter to configure how long it waits before calling the linter.

@codemirror/view 0.18.7 (2021-04-13)

Bug fixes

Fix a crash when drag-selecting out of the editor with editable turned off.

Backspace and delete now largely work in an editor without a keymap.

Pressing backspace on iOS should now properly update the virtual keyboard's capitalize and autocorrect state.

Prevent random line-wrapping in (non-wrapping) editors on Mobile Safari.

@codemirror/state 0.18.6 (2021-04-12)

New features

The new EditorState.wordAt method finds the word at a given position.

@codemirror/state 0.18.5 (2021-04-08)

Bug fixes

Fix an issue in the compiled output that would break the code when minified with terser.

@codemirror/view 0.18.6 (2021-04-08)

Bug fixes

Fix an issue in the compiled output that would break the code when minified with terser.

@codemirror/commands 0.18.1 (2021-04-08)

Bug fixes

Also bind Shift-Backspace and Shift-Delete in the default keymap (to do the same thing as the Shift-less binding).

New features

Adds a deleteToLineStart command.

Adds bindings for Cmd-Delete and Cmd-Backspace on macOS.

@codemirror/view 0.18.5 (2021-04-07)

Bug fixes

Improve handling of bidi text with brackets (conforming to Unicode 13's bidi algorithm).

Fix the position where drawSelection displays the cursor on bidi boundaries.

@codemirror/view 0.18.4 (2021-04-07)

Bug fixes

Fix an issue where the default focus ring gets obscured by the gutters and active line.

Fix an issue where the editor believed Chrome Android didn't support the CSS tab-size style.

Don't style active lines when there are non-empty selection ranges, so that the active line background doesn't obscure the selection.

Make iOS autocapitalize update properly when you press Enter.

@codemirror/state 0.18.4 (2021-04-06)

New features

The new Transaction.remote annotation can be used to mark and recognize transactions created by other actors.

@codemirror/collab 0.18.2 (2021-04-06)

Bug fixes

Add Transaction.remote annotation to transactions that include remote updates.

@codemirror/language 0.18.1 (2021-03-31)

Breaking changes

EditorParseContext.getSkippingParser now replaces EditorParseContext.skippingParser and allows you to provide a promise that'll cause parsing to start again. (The old property remains available until the next major release.)

Bug fixes

Fix an issue where nested parsers could see past the end of the nested region.

@codemirror/state 0.18.3 (2021-03-23)

New features

The ChangeDesc class now has toJSON and fromJSON methods.

@codemirror/view 0.18.3 (2021-03-19)

Breaking changes

The outer DOM element now has class cm-editor instead of cm-wrap (cm-wrap will be present as well until 0.19).

Bug fixes

Improve behavior of posAtCoords when the position is near text but not in any character's actual box.

@codemirror/view 0.18.2 (2021-03-19)

Bug fixes

Triple-clicking now selects the line break after the clicked line (if any).

Fix an issue where the drawSelection plugin would fail to draw the top line of the selection when it started in an empty line.

Fix an issue where, at the end of a specific type of composition on iOS, the editor read the DOM before the browser was done updating it.

@codemirror/search 0.18.2 (2021-03-19)

Bug fixes

The search interface and cursor will no longer include overlapping matches (aligning with what all other editors are doing).

New features

The package now exports a RegExpCursor which is a search cursor that matches regular expression patterns.

The search/replace interface now allows the user to use regular expressions.

The SearchCursor class now has a nextOverlapping method that includes matches that start inside the previous match.

Basic backslash escapes (\n, \r, \t, and \) are now accepted in string search patterns in the UI.

@codemirror/search 0.18.1 (2021-03-15)

Bug fixes

Fix an issue where entering an invalid input in the goto-line dialog would submit a form and reload the page.

@codemirror/autocomplete 0.18.3 (2021-03-15)

Bug fixes

Adjust to updated @codemirror/tooltip interface.

@codemirror/lint 0.18.1 (2021-03-15)

Bug fixes

Adjust to current @codemirror/panel and @codemirror/tooltip interfaces.

@codemirror/state 0.18.2 (2021-03-14)

Bug fixes

Fix unintended ES2020 output (the package contains ES6 code again).

@codemirror/autocomplete 0.18.2 (2021-03-14)

Bug fixes

Fix unintended ES2020 output (the package contains ES6 code again).

@codemirror/collab 0.18.1 (2021-03-12)

Breaking changes

Update objects now have a clientID field, and receiveUpdates no longer takes its ownUpdateCount argument, to simplify the interface.

@codemirror/autocomplete 0.18.1 (2021-03-11)

Bug fixes

Stop active completion when all sources resolve without producing any matches.

New features may now return a promise.

@codemirror/state 0.18.1 (2021-03-10)

New features

The new Compartment.get method can be used to get the content of a compartment in a given state.

@codemirror/view 0.18.1 (2021-03-05)

Bug fixes

Fix an issue where, on iOS, some types of IME would cause the composed content to be deleted when confirming a composition.

@codemirror/state 0.18.0 (2021-03-03)

Breaking changes

tagExtension and the reconfigure transaction spec property have been replaced with the concept of configuration compartments and reconfiguration effects (see Compartment, StateEffect.reconfigure, and StateEffect.appendConfig).

@codemirror/view 0.18.0 (2021-03-03)

Breaking changes

The themeClass function and ``-style selectors in themes are no longer supported (prefixing with cm- should be done manually now).

Themes must now use & (instead of an extra $) to target the editor wrapper element.

The editor no longer adds cm-light or cm-dark classes. Targeting light or dark configurations in base themes should now be done by using a &light or &dark top-level selector.

@codemirror/view 0.17.13 (2021-03-03)

Bug fixes

Work around a Firefox bug where it won't draw the cursor when it is between uneditable elements.

Fix a bug that broke built-in mouse event handling.

@codemirror/language 0.18.0 (2021-03-03)

Breaking changes

Update dependencies to 0.18.

Breaking changes

The Language constructor takes an additional argument that provides the top node type.

New features

Language instances now have a topNode property giving their top node type.

TreeIndentContext now has a continue method that allows an indenter to defer to the indentation of the parent nodes.

@codemirror/commands 0.18.0 (2021-03-03)

Breaking changes

Update dependencies to 0.18.

@codemirror/search 0.18.0 (2021-03-03)

Breaking changes

Update dependencies to 0.18.

@codemirror/autocomplete 0.18.0 (2021-03-03)

Bug fixes

Only preserve selected option across updates when it isn't the first option.

@codemirror/lint 0.18.0 (2021-03-03)

Bug fixes

Make sure action access keys are discoverable for screen reader users.

Selection in the lint panel should now be properly visible to screen readers.

@codemirror/collab 0.18.0 (2021-03-03)

Breaking changes

Update dependencies to 0.18.

@codemirror/language-data 0.18.0 (2021-03-03)

Breaking changes

Update dependencies to 0.18.

codemirror 0.18.0 (2021-03-03)

Breaking changes

Update dependencies to 0.18.

@codemirror/view 0.17.12 (2021-03-02)

Bug fixes

Avoid interfering with touch events, to allow native selection behavior.

Fix a bug that broke sub-selectors with multiple & placeholders in themes.

@codemirror/view 0.17.11 (2021-02-25)

Bug fixes

Fix vertical cursor motion on Safari with a larger line-height.

Fix incorrect selection drawing (with drawSelection) when the selection spans to just after a soft wrap point.

Fix an issue where compositions on Safari were inappropriately aborted in some circumstances.

The view will now redraw when the EditorView.phrases facet changes, to make sure translated text is properly updated.

@codemirror/commands 0.17.5 (2021-02-25)

Bug fixes

Use Alt-l for the default selectLine binding, because Mod-l already has an important meaning in the browser.

Make deleteGroupBackward/deleteGroupForward delete groups of whitespace when bigger than a single space.

Don't change lines that have the end of a range selection directly at their start in indentLess, indentMore, and indentSelection.

@codemirror/view 0.17.10 (2021-02-22)

Bug fixes

Long words without spaces, when line-wrapping is enabled, are now properly broken.

Fix the horizontal position of selections drawn by drawSelection in right-to-left editors with a scrollbar.

@codemirror/state 0.17.2 (2021-02-19)

New features and now take an optional second argument to indicate which direction to map to.

@codemirror/language 0.17.5 (2021-02-19)

New features

This package now exports a foldInside helper function, a fold function that should work for most delimited node types.

@codemirror/view 0.17.9 (2021-02-18)

Bug fixes

Fix an issue where pasting linewise at the start of a line left the cursor before the inserted content.

@codemirror/commands 0.17.4 (2021-02-18)

Bug fixes

Fix a bug where deleteToLineEnd would delete the rest of the document when at the end of a line.

@codemirror/view 0.17.8 (2021-02-16)

Bug fixes

Fix a problem where the DOM selection and the editor state could get out of sync in non-editable mode.

Fix a crash when the editor was hidden on Safari, due to getClientRects returning an empty list.

Prevent Firefox from making the scrollable element keyboard-focusable.

@codemirror/commands 0.17.3 (2021-02-16)

Bug fixes

Fix an issue where insertNewlineAndIndent behaved strangely with the cursor between brackets that sat on different lines.

@codemirror/view 0.17.7 (2021-01-25)

New features

Add an EditorView.announce state effect that can be used to conveniently provide screen reader announcements.

@codemirror/view 0.17.6 (2021-01-22)

Bug fixes

Avoid creating very high scroll containers for large documents so that we don't overflow the DOM's fixed-precision numbers.

@codemirror/commands 0.17.2 (2021-01-22)

New features

The new insertTab command inserts a tab when nothing is selected, and defers to indentMore otherwise.

The package now exports a defaultTabBinding object that provides a recommended binding for tab (if you must bind tab).

@codemirror/autocomplete 0.17.4 (2021-01-18)

Bug fixes

Fix a styling issue where the selection had become invisible inside snippet fields (when using drawSelection).

New features

Snippet fields can now be selected with the pointing device (so that they are usable on touch devices).

@codemirror/autocomplete 0.17.3 (2021-01-18)

Bug fixes

Fix a bug where uppercase completions would be incorrectly matched against the typed input.

@codemirror/view 0.17.5 (2021-01-15)

Bug fixes

Fix a bug that would create space-filling placeholders with incorrect height when document is very large.

@codemirror/language 0.17.4 (2021-01-15)

@codemirror/language 0.17.3 (2021-01-15)

Bug fixes

Parse scheduling has been improved to reduce the likelyhood of the user looking at unparsed code in big documents.

Prevent parser from running too far past the current viewport in huge documents.

@codemirror/view 0.17.4 (2021-01-14)

Bug fixes

The drawSelection extension will now reuse cursor DOM nodes when the number of cursors stays the same, allowing some degree of cursor transition animation.

Makes highlighted special characters styleable (``) and fix their default look in dark themes to have appropriate contrast.

New features

Adds a new MatchDecorator helper class which can be used to easily maintain decorations on content that matches a regular expression.

@codemirror/autocomplete 0.17.2 (2021-01-12)

Bug fixes

Don't bind Cmd-Space on macOS, since that already has a system default binding. Use Ctrl-Space for autocompletion.

@codemirror/language-data 0.17.2 (2021-01-07)

Bug fixes

Properly mark dependencies on the packages that are dynamically imported in package.json.

@codemirror/state 0.17.1 (2021-01-06)

New features

The package now also exports a CommonJS module.

@codemirror/view 0.17.3 (2021-01-06)

New features

The package now also exports a CommonJS module.

@codemirror/language 0.17.2 (2021-01-06)

New features

The package now also exports a CommonJS module.

@codemirror/commands 0.17.1 (2021-01-06)

New features

The package now also exports a CommonJS module.

@codemirror/search 0.17.1 (2021-01-06)

New features

The package now also exports a CommonJS module.

@codemirror/autocomplete 0.17.1 (2021-01-06)

New features

The package now also exports a CommonJS module.

@codemirror/lint 0.17.1 (2021-01-06)

New features

The package now also exports a CommonJS module.

@codemirror/collab 0.17.1 (2021-01-06)

New features

The package now also exports a CommonJS module.

@codemirror/language-data 0.17.1 (2021-01-06)

New features

The package now also exports a CommonJS module.

codemirror 0.17.1 (2021-01-06)

Bug fixes

Putting a theme after the basic setup no longer causes the default highlighter to be used with the theme's editor styling.

New features

The package now also exports a CommonJS module.

@codemirror/view 0.17.2 (2021-01-04)

Bug fixes

Work around Chrome problem where the native shift-enter behavior inserts two line breaks.

Make bracket closing and bracket pair removing more reliable on Android.

Fix bad cursor position and superfluous change transactions after pressing enter when in a composition on Android.

Fix issue where the wrong character was deleted when backspacing out a character before an identical copy of that character on Android.

@codemirror/view 0.17.1 (2020-12-30)

Bug fixes

Fix a bug that prevented ViewUpdate.focusChanged from ever being true.

@codemirror/language 0.17.1 (2020-12-30)

Bug fixes

Fix a bug where changing the editor configuration wouldn't update the language parser used.

@codemirror/state 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/view 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/language 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/commands 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/search 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/autocomplete 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/lint 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/collab 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/language-data 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

codemirror 0.17.0 (2020-12-29)

Breaking changes

First numbered release.

@codemirror/next 0.16.0 (2020-12-28)

Breaking changes

hoverTooltip's callback function now takes a position and a side, rather than a predicate function, to determine whether a tooltip should be shown.

The highlightStyle function, which defines a highlight style, is now called HighlightStyle.define.

completeSnippets no longer exists. Use completeFromList in combination with snippetCompletion.

The ...Support functions that some language packages exported are gone, since it is now possible to get the support extensions directly from the package's main function.

The language facet now returns an optional single language, not an array anymore.

Languages no longer have getTree and ensureTree methods.

keymap is now a facet, rather than a function, which means you have to use it with keymap.of(...).

The markers option to gutters now takes a view, rather than a state, as argument.

The completionKeymap array now contains more default bindings.

Removes support for Text.iterLines.

Line objects no longer have slice and findClusterBreak methods (use text and the top-level findClusterBreak function instead).

EditorSelection.primary is now called EditorSelection.main.

rectangularSelection now takes its configuration as an object.

A state field's provide option works differently. It now takes a function from the field to an extension. Facet.from has been changed to make it easy to use with this option.

To set an extension's precedence, use the properties of the Prec object instead of the old precedence function.

ViewUpdate.prevState has been renamed to startState.

The gotoLine command is now part of the search package.

highlightActiveLine is now exported from the view package instead of the highlight-selection package.

The highlightSelectionMatches extension is now part of the search package.

Bug fixes

Fix issue where hoverTooltip would falsely believe the mouse was outside of the editor when initialized with the pointer already on the editor.

Drop duplicate completions.

New features

Highlight styles are now instances of an exported HighlightStyle class, which allows you to get at its style module and match it against tags.

The highlight package exports a new function, highlightTree, which runs the tree highlighter over a Lezer tree and tells you which styling should be applied where.

Language objects now have a parseString method that can be used to synchronously parse a string of code in that language.

When configuring an XML schema, it is now possible to provide text to complete into a given element.

Language objects now have a findRegions method that tells you where in the document the language occurs.

Language objects have a new isActiveAt method that tells you whether the language is active at a given point.

The Markdown package now exports two new commands, insertNewlineContinueMarkup and deleteMarkupBackward, to help with editing Markdown.

The new language-data package lists a large number of modes, with some metadata to help locate the one you're interested in.

The language package now exports a LanguageDescription type that can be used to provide metadata about language packages.

The CSS language package now exports a basic CSS completion source.

Language packages' main interface function now returns an instance of LanguageSupport which provides access both to support extensions and the main language.

The new top-level ensureSyntaxTree function in the language package replaces Language.ensureTree.

Facets can now come with extensions that should be enabled when they are present in a state.

The keys used for snippet field navigation are now configurable through the snippetKeymap facet.

The autocomplete package now exports a completeAnyWord function that will gather completions from any words found in the document.

You can now pass defaultKeymap: false to autocompletion to prevent it from adding its default completion keymap.

StateField.init can now be used to provide a custom initial value for a field.

EditorState.toJSON and fromJSON now allow you to opt in to serializing state fields.

Line objects now have a text property holding their entire content.

The new toggleComment command will automatically create a line or block comment depending on what syntax the language supports.

The gotoLine command now allows relative offsets (with + and -), percentages (with a % at the end) and column positions (using : before the column number)

@codemirror/next 0.15.0 (2020-12-04)

Breaking changes

The highlighting system no longer has the concept of a tag system—rather, all tags now exist in the same space.

Highlighting tags are now represented by objects (with the default tag system under tags in the highlight package) rather than strings.

Highlighting styles are now registered separately from the actual highlighter plugin. Syntax addons take care of registering the highlighter. Styles are defined with the highlightStyle function.

The syntax package no longer exists. Its responsibilities have been taken over by the language package.

Language and syntax-related functionality that used to live in the state package (the syntax provider type, props like indentation and foldable) has been moved to the language package.

The stream-syntax package has been renamed to stream-parser, and its interface has been changed to make use of the abstractions provided by the language package.

Providing language data now works differently (the globalLanguageData facet is gone, replaced by a more general languageData facet).

EditorState.tree has been replaced by the syntaxTree function from the language package (since the state package no longer knows about Lezer types).

The ...Syntax exports from language packages have all been renamed to ...Language for consistency with the library's terminology.

Bug fixes

closeBrackets will no longer type-over brackets that it did not itself insert.

Selection drawing in wrapped lines is no longer entirely broken.

Fix an issue where autocompletion wouldn't trigger when an IME composition moved the selection before ending.

Fix a bug where the facet dependency tracking got confused when a dynamic facet depended on another facet that didn't exist in the state.

Querying the coordinates (and thus drawing the cursor) before a block widget no longer crashes.

Fix double-height cursor on line wrap points in Safari.

Actually call ignoreEvent methods on block widgets.

Prevent drawSelection from also hiding the native selection in block widgets.

A text cursor created with Text.iterLines now actually respects the skip parameter.

New Features

The language package now provides most language and parsing related infrastructure. Unlike the old syntax package, it is parse-technique-agnostic. Some of the interfaces that used to live in state, such as the facets and types involved in indentation and folding, have also moved there.

The function passed to changeByRange may now also return effects for each range.

The new State.transactionExtender facet allows you to register functions that add annotations, effects, or reconfiguration to transactions even when they have disabled regular transaction filters.

The new lang-markdown package provides Markdown highlighting.

The foldable function exported from the language package provides an easy way to check whether a given line is foldable.

The getIndentation utility from the language package should now be used to compute automatic indentation for a line. It returns null, as opposed to -1, to indicate that it has no indentation for a given line.

@codemirror/next 0.14.0 (2020-10-23)

Breaking changes

Lezer and lezer-tree have been upgraded to 0.12, which introduces a few breaking changes.

ChangeDesc.mapPos now returns null instead of -1 when reporting a deletion.

EditorView.posAtCoords now returns null, rather than -1, when it fails to find a position.

Bug fixes

Fix an issue where Chrome's shift-enter shortcut confused the editor.

Clicking on the completion list scrollbar no longer selects the first completion.

New features

The lang-json package now exports a jsonParseLinter function that produces a linter based on JSON.parse.

@codemirror/next 0.13.1 (2020-10-14)

Bug fixes

Fix an occasional crash on vertical cursor motion through a scrollable editor.

Fix a bug that caused Change.fromJSON to return invalid change objects in some cases.

Fix a bug where the selection and cursor were drawn in the wrong place in a scrolled editor.

@codemirror/next 0.13.0 (2020-10-01)

Breaking changes

Themes are now specified differently, using plain CSS selectors extended with $ syntax for targeting theme classes. This should make them more flexible.

The style-mod dependency has been upgraded to 3.0, which is a backward-incompatible upgrade.

The multipleSelections extension is no longer supported. You probably want to use drawSelection combined with EditorState.allowMultipleSelections.of(true).

WidgetType no longer takes a type parameter. Implementations are now themselves responsible for creating instance variables and implementing an appropriate eq method.

Drops support for PluginValue.measure (which was very broken already in the previous release).

Bug fixes

The editor no longer loses focus when picking a completion with the mouse.

Fix a bug that caused completion info tooltips to be positioned off-screen.

New features

There is now an SQL language module.

The autocomplete package now exports an ifNotIn helper that can turn off completion sources when the cursor is in a given token type.

There is now a lang-xml package with basic XML support.

ViewUpdate objects now have a geometryChanged getter that tells you whether the geometry of the content changed.

The view module now exports a drawSelection function that creates an extension that overrides the native selection drawing.

Scroll handlers registered view EditorView.domEventHandlers or view plugins will now be called any time the view or an ancestor of the view is scrolled.

DOM event handlers may now return void, for convenience.

There is now a lang-rust package.

The view package now exports a placeholder function that can be used to create a placeholder shown when the editor is empty.

The editor view now has a composing property indicating whether IME is active.

The autocomplete package now exports acceptCompletion and moveCompletionSelection commands.

@codemirror/next 0.12.0 (2020-09-11)

Breaking changes

The way overlapping mark decorations are handled has changed. The editor will now create a separate element for each decoration, and nested them in order of the predecence of the sources that created them (higher precedence wrapping lower precedence, decorations from the state facet wrapping decorations from view plugins).

Registering decorations, event handlers, or other plugin values for a view plugin is now done differently (with an argument to ViewPlugin.define or ViewPlugin.fromClass, rather than method calls on the returned value).

Bug fixes

Vertical cursor motion when the selection isn't empty will now properly collapse it to the appropriate side, rather than moving from the selection head.

Fix the activateOnTyping option to the autocomplete system.

The default backspace binding now deletes by code point, not character.

Tooltips are no longer cut off by scrollable parent elements.

New features

StreamParser now allows an optional tagSystem property to use a custom tag system.

Elements created for mark decorations can now span multiple child elements (raw text, or elements created for lower-precedence marks or widgets).

There is now a lang-java package with a Java syntax.

There is now a dedicated syntax tag for boolean literals ("bool").

Add a C++ syntax.

New commands deleteCodePointForward/Backward.

The editor view now has an inView getter that tells you if the editor is in view at all.

View plugins can now provide a measure method that gets called when the view measures itself.

@codemirror/next 0.11.0 (2020-09-03)

Breaking changes

Autocompletion contexts no longer have a filter method. Completion sources shouldn't filter anymore, but leave that to the plugin.

The filterDownOn property on completion results is now called span.

AutocompleteContext.tokenBefore now takes a list of token type names, and only returns tokens of those types. (In its previous form, it was too error-prone.)

Snippet specs no longer support a name property (use detail instead).

A number of exports from the autocomplete plugin were renamed: autocomplete to autocompletion, AutocompleteContext to CompletionContext, Autocompleter to CompletionSource.

SnippetSpec objects are now a subclass of Completion (which mostly means that their keyword property was renamed to label).

Bug fixes

Fix issue that could cause crashes or incorrectly mapped selections in the history when making changes with addToHistory set to false.

Fuzzy completion matching got a lot more clever, and presents results ordered by match quality.

New features

Text copied linewise will now be inserted as lines above the selection when pasted into an empty selection.

The completion list now shows the matched parts of the strings.

The autocomplete package now exports two new functions, completionStatus and currentCompletions, that let external code query its state.

A new method matchBefore on the autocompletion context can now be used to easily find the text matching a given regexp before the cursor.

Completion contexts now have aborted and addEventListener(abort, ...) properties to allow asynchronous completion queries to stop doing work when cancelled.

Completions now support a detail property to add some extra text after their label.

Completions can now have a boost property to influence the way they are sorted compared to other completions that match the input equally well.

Completions can now have an info property that provides extra information to be shown next to the completion when it is selected.

ChangeSet now has a toJSON method and a static fromJSON method to serialize to and deserialize from JSON.

@codemirror/next 0.10.0 (2020-08-11)

Breaking changes

LezerSyntax instances are now created with LezerSyntax.define instead of new LezerSyntax.

Transaction and change filters are now passed a full transaction as argument.

The ResolvedTransactionSpec type is no longer part of the interface.

The reconfigured property on transactions has been renamed to reconfigure. Similarly, the scrolledIntoView property is now called scrollIntoView.

Editor state objects no longer have an indentWithTabs property.

Bug fixes

Fix an issue where language data at the end of an unfinished nested grammar at the end of the document would use the outer language instead of the inner.

New features

A LezerSyntax instance can now specify a dialect to parse.

Transactions now have a newDoc property that allows you to access the updated document before the new state has been created.

The indentString property on editor states can be used to compute an indentation string of a given column width.

The view package now exports an indentOnInput extension that enables automatic reindentation when certain patterns are typed at the start of a line. The basic setup enables this.

When the cursor is between matching brackets, insertNewlineAndIndent will insert an additional newline after the cursor.

Transaction specs now support a sequential property, which causes them to be interpreted in the document space as produced by earlier specs.

@codemirror/next 0.9.0 (2020-07-30)

Breaking changes

The backspace behavior in the closebrackets package is no longer implicitly included in the extension returned by closeBrackets().

Bug fixes

Fix a crash when running deleteCharBackward when the cursor is at the start of the document.

Fix a bug in Line.slice that would cause it to loop infinitely on long lines.

Make sure the DOM is reset when dispatch fails to update the view.

Fix an issue where double-clicking on a selection in Chrome would leave you with just a cursor, not a selected word.

New features

Highlighting information for a syntax (as in styleTags) can now prefix tag names with ! to make them override the styling of any child nodes for that syntax node.

It is now possible, when specifying syntax highlighting information, to write rules for a node that apply only when its parent nodes are of a given type. This uses / syntax, as in "Declaration/Identifier": "className".

Completion items can now specify a type property that determines the icon shown next to them.

EditorView.inputHandler can now be used to override the way text input (via the DOM) is handled.

The closebrackets package now exports its backspace behavior as a command (deleteBracketPair) and a set of bindings that bind it to backspace as closeBracketsKeymap.

@codemirror/next 0.8.0 (2020-06-29)

Breaking changes

closeBrackets is now a function, rather than an extension value.

The keymap, special-chars, and multiple-selections packages have been merged into the view package.

The way tooltips are declared changed somewhat to fix an issue with tooltips that stay active across document changes.

Assigning precedences to extension is now done using a plain precedence function, rather than a class.

The new state is no longer passed to state field update functions (it is part of the transaction anyway now).

The start and end properties of Line have been renamed to from and to for consistency.

EditorView.lineAt is now called visualLineAt. Its second argument now defaults to 0.

EditorView.lineAtHeight is now called visualLineAtHeight.

The fillConfig utility is no longer part of the library (the library depends on Object.assign now, which provides a standard way to do the same thing).

Completion sources now get all their arguments as properties of the context object.

Language-specific data is now stored in a facet attached to the syntax object, rather than directly in a node prop.

Reconfiguring transactions are now specified in a slightly different way.

Bug fixes

Fix an issue where the selection was unnecessarily moved to the start of the document when clicking on an unfocused editor.

Work around an issue where sometimes the selection would end in the wrong place on Chrome (because the browser reports a different selection from the one it displays.

Fix an issue where disabling the gutter extension would leave its DOM element in the editor.

New features

The EditorView.updateListener facet can be used to have an external function listening for view updates.

The goto-line package now exports a gotoLineKeymap extension.

The new basic-setup package pulls together all the core extensions into a single configuration value.

You can now move through completions with PageUp and PageDown

The editor view now has a setState method to reset its state (again).

The autocomplete package now exports functionality for completing to 'snippets' (longer pieces of text with fields that can be filled in one at a time).

LezerSyntax instances can now directly specify inherent language data (such as comment syntax).

Language packages now export their supporting extensions (if any) as a separate 'support' value.

Autocompletion can now be configured to ask for case-sensitivity.

Completion results can now specify a filterDownOn property to allow the list to be cheaply updated as the user continues typing.

The autocomplete package now exports a completeFromList helper to easily construct a completer from a list of options.

EditorView.dispatch can now be directly called with transaction specs (rather than always calling view.state.update to create its argument).

It is now possible to append extensions from transactions.

Transaction filters can now request the full transaction for the (current) transaction spec if they need it.

@codemirror/next 0.7.1 (2020-06-12)

Bug fixes

Fix an issue where using Enter during composition would insert a newline.

Fix a problem where the library ignored platform-specific key bindings when building a keymap.

@codemirror/next 0.7.0 (2020-06-11)

Breaking changes

EditorView.startMouseSelection has been replaced with the EditorView.mouseSelectionStyle facet, which works somewhat differently.

The indentUnit facet now takes a string, rather than a number, and allows a string of tabs to be specified.

The text package no longer exports isExtendingChar. Use the new cluster break functions instead.

Text direction is now represented as an enum (Direction from the view package) rather than a string.

Selection ranges should be created with EditorSelection.range and EditorSelection.cursor now, rather than directly calling the constructor.

The by-group selection motion commands like moveWordLeft have been renamed to contain 'group' rather than 'word' (moveGroupLeft).

EditorView.movePos has been removed. Use the new cursor motion methods instead.

The keyboard and pointer values for Transaction.userEvent have been renamed keyboardselection and pointerselection.

Commands that move the selection are now prefixed with cursor (cursorCharLeft), and those that extend the selection are prefixed with select (selectGroupForward).

Key bindings are no longer specified as objects, but as arrays of KeyBinding specs, one per binding.

Matching delimiters in syntax trees are now registered with NodeProp.openedBy/closedBy instead of custom props exported from the syntax module.

The lint package's interface was simplified to automatically enable the required extensions when necessary, rather than requiring them to be enabled when configuring the editor.

Bug fixes

Indentation-related commands will now use tabs to indent when appropriate.

The default key bindings on macOS are now a lot closer to how native editor interfaces behave.

New features

The editor view now has a scrollPosIntoView method to scroll a given document position into view.

Add a new package rectangular-selection, which implements rectangle selection on alt-drag.

New indentWithTabs getter on the editor state, which indicates whether indentation should use tabs.

The commands package now exports indentMore and indentLess commands, which unconditionally add/remove indentation on selected lines.

The editor view now has a bidiSpans method to retrieve the text order for a given line.

The text package now exports nextClusterBreak and prevClusterBreak, which can be used to find grapheme cluster breaks in a string.

The new EditorView methods moveByChar, moveByGroup, and moveToLineBoundary can be used to compute cursor motion (in a bidi-aware way).

The view method moveVertically can now be used to compute vertical cursor motion.

Line objects now have a findClusterBreak method for more convenient by-cluster motion.

New commands movePageUp/Down, extendPageUp/Down, deleteGroupForward/Backward.

The view class now has a lineWrapping property that indicates whether line wrapping is enabled for the editor.

EditorView.lineWrapping now holds an extension that enables line wrapping.

Add forward/backward variants of many commands that only support left/right before.

New commands transposeChars, splitLine, and deleteToLineEnd to support macOS's Emacs-style default bindings. New export emacsStyleBaseKeymap that contains these and other Emacs-style bindings.

New commands moveLineBoundaryForward, moveLineBoundaryBackward, extendLineBoundaryForward, and extendLineBoundaryBackward.

New commands extendDocStart and extendDocEnd.

When copying or cutting without a selection, the editor will copy or cut by line.

When pasting N lines while the selection has N active ranges, the editor will now paste one line into each range.

The new EditorState.lineBreak property gives you the proper line break string for a state.

New commands moveLineUp/Down and copyLineUp/Down, bound to Alt-ArrowUp/Down and Shift-Alt-ArrowUp/Down by default.

New command deleteLine, bound to Shift-Mod-k by default.

New commands cursorMatchingBracket and selectMatchingBracket.

It is now possible to customize the DOM element that editor panels are placed into.

The panel extension now has a getPanel accessor to retrieve the panel created by a given constructor function.

New command nextLintDiagnostic to jump to the next linter message.

The new selectParentSyntax command selects the syntax node around the selection.

New commands cursor/selectSyntaxLeft/Right to jump over tokens or bracketed syntactic constructs.

New commands foldAll and unfoldAll.

The fold package now exports a default keymap foldKeymap

The comment package now exports a commentKeymap binding.

New command selectLine.

The new highlightActiveLine extension can be used to style lines with a cursor on them.

New extension highlightSelectionMatches, which enables highlighting of text that matches the current selection.

When defining a highlighter, it is now possible to assign a style to multiple tags by separating them by commas in the property name.

New theme package: theme-one-dark.

Key bindings may now involve multiple key strokes (specified as a space-separated string of key names).

Key bindings that include a preventDefault property will now cause the key event to be stopped even when the bound command(s) return false.

New command: deleteTrailingWhitespace.

New command selectSelectionMatches that selects all instances of the currently selected string.

You can now pass a parent option to a view to append it to the DOM right away.

@codemirror/next 0.6.0 (2020-05-13)

New features

There is now a comment package with commenting/uncommenting commands.

The new collab package implements a framework for collaborative editing.

When creating or updating a state, the selection may now be specified as an {anchor, head?} object literal.

There are new methods toText and sliceDoc on the editor state for working with strings.

Some methods that used to be part of Transaction now have an equivalent on the state object. replaceSelection moved there. changeByRange replaces Transaction.forEachRange. And changes can be used to build up a changeset.

Breaking changes

The Text class interface changed to make better use of its own abstraction. replace takes a Text instance instead of an array of strings, slice now returns a Text, and there's a new append method.

The representation of changes and change sets has been redone. Instead of storing a sequence of change objects, change sets are now a flat map of the locations in the document that changed.

The way transactions work has changed. They are now immutable objects created with EditorState.update.

Transaction filtering works differently now. See the changeFilter and transactionFilter facets.

What used to be extension groups is now called tagged extensions (using the tagExtension function).

mapPos now returns -1 to indicate deletion (when the map mode asks for this).

@codemirror/next 0.5.2 (2020-04-09)

Bug fixes

Fix an issue where external TypeScript builds would try to recompile the library code.

@codemirror/next 0.5.1 (2020-04-08)

Bug fixes

Include the TypeScript declaration files in the npm package.

@codemirror/next 0.5.0 (2020-04-01)

Breaking changes

EditorView.domEventHandlers is now a function, and the handlers receive their arguments in a different order.

Syntax objects no longer have a languageDataAt method (this was moved to EditorState, and changed somewhat).

Completion functions now return a plain list of results, rather than an object.

The interface to EditorState.indentation changed, taking an IndentContext object.

Facets provided by a state field are now declared in an option to StateField.define, instead of in method calls on the field object.

Isolating transactions so that they become their own undo history item is now done with the isolateHistory annotation.

The packages are no longer available as CommonJS files. To run the code on node.js, you'll need node 13 or pass --experimental-modules to node 12.

New features

View plugins now have an eventHandlers method to attach plugin-specific DOM event handlers.

The editor state now has a languageDataAt that collects values stored under a given property name in the main language data and in object attached for a given document type with the addLanguageData facet.

It is now possible to provide indentation functions with information about already-reindented lines through an IndentContext object, making it possible to reindent a region in one go without re-parsing.

Lint sources can now be asynchronous.

The EditorView.editable facet can now be used to control whether the content is editable.

The selectionFilter facet can now be used to control selection updates.

The new changeFilter facet can be used to stop or modify document changes.

Transaction.change now also accepts an array of changes to apply in one go.

The history module now exports a facet that allows you to create inverted effects from a transaction, which will be stored in the history. (This allows making non-document state un/redoable.)

Transactions can now contains state effects, which can describe state changes for extensions, and be integrated with the undo history.

Transactions now have a mapRef method to easily create a position mapping from a given intermediate document to the current document.

@codemirror/next 0.4.0 (2020-02-21)

Breaking Changes

Behavior was renamed to Facet, and works somewhat differently.

The extension package no longer exists. Extension-related concepts are now part of the state package.

The view no longer has its own extension system. It is entirely configured by state extensions.

View plugins are specified through a state facet now, and have a simpler interface.

View plugins may no longer create decorations that significantly impact the height of content, to avoid the cyclic dependency between plugin decorations and the viewport.

Themes work differently now, using static CSS classes on DOM elements so that plugins don't have to update their DOM when the editor theme changes.

Highlighting token types now support a numeric suffix, which replaces the old typeN modifiers.

The interface to syntax extensions and parse trees changed.

The way transaction annotations work was simplified a bit.

Range sets were rewritten and support a somewhat different interface now.

The way decorations are created now separates the creation of the decoration value from the creation of the range to which it should apply.

New features

State facets can provide decorations now.

Reading DOM layout information and similar things is now done with the requestMeasure method.

Facets now explicitly track which fields and other facets they depend on, so that they are recomputed only when necessary.

Any object that has an extension property that holds an extension value may now be used as an extension.

Overlong lines that are inside the viewport will now be partially hidden to speed up rendering and interaction.

The editor view now has a textDirection property telling you whether the main writing direction is left-to-right or right-to-left.

There's now a visibleRanges property that tells you which part of the viewport is actually going to be drawn, speeding up things like highlighting when there's large amounts of collapsed code in the viewport.

Bug fixes

Fix issue where mouse dragging would create selections with the the anchor and head reversed.

Make code folding behave better when the folded node doesn't start on the same line as the actual fold.

Fix a number of issues that would make parsing big files slow (or even lock up entirely).

@codemirror/next 0.3.0 (2019-11-29)

Breaking changes

Language-wide configuration is no longer stored in per-extension node props, but in a single languageData object held in a prop defined in the state package. The Syntax method languageDataAt is used to read it.

Unique extensions no longer exist. Instead, extensions are deduplicated by identity. Merging configurations for an extension should now be done in a behavior.

Bug fixes

Fix issue where starting with an empty editor would break height estimates.

Fix an issue where widgets at the end of a line could stay around after being deleted in some cases.

Fix rendering of lines that are empty except for a widget.

New features

A plugin's drawMeasured method may now return true to request another measure/draw cycle.

The editor view now has a requireMeasure method to schedule a layout check that'll allow plugins to measure and update the DOM.

The state package now re-exports the Text type.

Add an adaptor for connecting ESLint output to the CodeMirror linter package to the lang-javascript package.

The tooltip package provides a way to show tooltip over the editor.

The new autocomplete package implements an autocompletion interface.

The new lint package integrates linting with the editor by underlining issues and providing a list of problems that you can scroll through.

The lang-javascript package now exports an esLint function that can be used to wire up ESLint to the CodeMirror lint integration.

@codemirror/next 0.2.0 (2019-10-28)

Breaking changes

syntaxIndentation no longer has to be registered separately as an extension. It is now implied when registering a tree syntax.

The configuration passed to gutter no longer takes direct class names, but a style option that determines the theme fields used for the gutter.

ViewPlugin instances are now created with a static create method, instead of the constructor.

Declaring custom gutters is now done with a Gutter constructor.

Configuring whether the gutters are fixed is now done with the gutters extension, rather than per individual gutter.

There is now an additional wrapper element around the editor (EditorView.scrollDOM), which is the element that should be targeted with overflow style properties.

EditorView.cssClass no longer accepts space-separated lists of classes.

Slot from the extension package has been replaced with Annotation in the state package. Transaction metadata is now called annotations, and the method names have been updated accordingly.

Command from state was renamed to StateCommand, ViewCommand from view is now called Command.

Bug fixes

Fix a bug where a behavior's combine method wasn't called when the behavior was entirely static.

Fix issue that caused nested replaced decorations to be drawn incorrectly.

ViewUpdate.themeChanged no longer returns the inverse of what it should be returning.

Avoid crash on Firefox when focusing the editor if another form field has focus.

Fixes a bug where changes near replacing decorations would corrupt the editor's view of its height layout.

New features

The new EditorState.foldable behavior provides a way to register code folding services.

Lezer syntax can now register code folding metadata on tree nodes via foldNodeProp.

There is now a fold package with code folding commands (which need the codeFolding extension to be active to work).

EditorView.posFromDOM can now be used to find the document position of a given DOM position.

Gutters can now be themed.

ViewPlugin instances can be extended with dynamic behavior using their behavior and decorations methods.

Gutters can now be passed a handleDOMEvents option that allows client code to register event handlers on them.

You can now iterate over a RangeSet more cheaply with an (internal) iterator using the between method.

Syntax services now have a docTypeAt method that gives you the grammar node around the given point (which may be part of a nesting grammar).

The text package now has replacements for codePointAt and fromCodePoint.

Added a bracket-closing extension in the closebrackets package.

Adds a panel package that contains functionality for showing UI panels at the top or bottom of the editor.

The new search package provides search/replace-related functionality.

Themes and EditorView.cssClass can now target dot-separated more specific versions of a name.

The phrase method on the editor view can now be used to access translation provided with the EditorView.phrases behavior.

Widget toDOM methods are now passed the editor view.

Add EditorView.scrollMargins behavior, which can be used to make the view scroll past regions at the side of the editor when scrolling something into view.

The keymap package now exports a NormalizedKeymap class that can be used to build key handlers on other elements.

@codemirror/next 0.1.0 (2019-10-10)

Breaking Changes

First numbered release.