@codemirror/view
Advanced tools
Changelog
0.19.26 (2021-12-03)
Widgets can now define a destroy
method that is called when they are removed from the view.
Changelog
0.19.25 (2021-12-02)
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.
EditorView.editorAttributes
and contentAttributes
may now hold functions that produce the attributes.
Changelog
0.19.24 (2021-12-01)
Fix a bug where lineBlockAt
, for queries inside the viewport, would always return the first line in the viewport.
Changelog
0.19.23 (2021-11-30)
Fix an issue where after some kinds of changes, EditorView.viewportLineBlocks
held an out-of-date set of blocks.
Export EditorView.documentPadding
, with information about the vertical padding of the document.
Changelog
0.19.22 (2021-11-30)
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.
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.
Changelog
0.19.21 (2021-11-26)
Fix a problem where the DOM update would unnecessarily trigger browser relayouts.
Changelog
0.19.20 (2021-11-19)
Run a measure cycle when the editor's size spontaneously changes.
Changelog
0.19.19 (2021-11-17)
Fix a bug that caused the precedence of editorAttributes
and contentAttributes
to be inverted, making lower-precedence extensions override higher-precedence ones.
Changelog
0.19.18 (2021-11-16)
Fix an issue where the editor wasn't aware it was line-wrapping with its own lineWrapping
extension enabled.