Releases: codemirror/codemirror5
5.27.0
Version 5.27.0
Bug fixes
Fix infinite loop in forced display update.
Properly disable the hidden textarea when readOnly is "nocursor".
Calling the Doc constructor without new works again.
sql mode: Handle nested comments.
javascript mode: Improve support for TypeScript syntax.
markdown mode: Fix bug where markup was ignored on indented paragraph lines.
vim bindings: Referencing invalid registers no longer causes an uncaught exception.
rust mode: Add the correct MIME type.
matchbrackets addon: Document options.
New features
Mouse button clicks can now be bound in keymaps by using names like "LeftClick" or "Ctrl-Alt-MiddleTripleClick". When bound to a function, that function will be passed the position of the click as second argument.
The behavior of mouse selection and dragging can now be customized with the configureMouse option.
Modes can now look ahead across line boundaries with the StringStream.lookahead method.
Introduces a "type" token type, makes modes that recognize types output it, and add styling for it to the themes.
New pasteLinesPerSelection option to control the behavior of pasting multiple lines into multiple selections.
searchcursor addon: Support multi-line regular expression matches, and normalize strings when matching.
5.26.0
Version 5.26.0
Bug fixes
In textarea-mode, don't reset the input field during composition.
More careful restoration of selections in widgets, during editor redraw.
javascript mode: More TypeScript parsing fixes.
julia mode: Fix issue where the mode gets stuck.
markdown mode: Understand cross-line links, parse all bracketed things as links.
soy mode: Support single-quoted strings.
go mode: Don't try to indent inside strings or comments.
New features
vim bindings: Parse line offsets in line or range specs.
5.25.2
Version 5.25.2
Bug fixes
Better handling of selections that cover the whole viewport in contentEditable-mode.
No longer accidentally scroll the editor into view when calling setValue.
Work around Chrome Android bug when converting screen coordinates to editor positions.
Make sure long-clicking a selection sets a cursor and doesn't show the editor losing focus.
Fix issue where pointer events were incorrectly disabled on Chrome's overlay scrollbars.
javascript mode: Recognize annotations and TypeScript-style type parameters.
shell mode: Handle nested braces.
markdown mode: Make parsing of strong/em delimiters CommonMark-compliant.
5.25.0
Version 5.25.0
Bug fixes
In contentEditable-mode, properly locate changes that repeat a character when inserted with IME.
Fix handling of selections bigger than the viewport in contentEditable mode.
Improve handling of changes that insert or delete lines in contentEditable mode.
Count Unicode control characters 0x80 to 0x9F as special (non-printing) chars.
Fix handling of shadow DOM roots when finding the active element.
Add role=presentation to more DOM elements to improve screen reader support.
merge addon: Make aligning of unchanged chunks more robust.
comment addon: Fix comment-toggling on a block of text that starts and ends in a (differnet) block comment.
javascript mode: Improve support for TypeScript syntax.
r mode: Fix indentation after semicolon-less statements.
shell mode: Properly handle escaped parentheses in parenthesized expressions.
markdown mode: Fix a few bugs around leaving fenced code blocks.
soy mode: Improve indentation.
New features
lint addon: Support asynchronous linters that return promises.
continuelist addon: Support continuing task lists.
vim bindings: Make Y behave like yy.
sql mode: Support sqlite dialect.
5.24.0
Version 5.24.0
Bug fixes
A cursor directly before a line-wrapping break is now drawn before or after the line break depending on which direction you arrived from.
Visual cursor motion in line-wrapped right-to-left text should be much more correct.
Fix bug in handling of read-only marked text.
shell mode: Properly tokenize nested parentheses.
python mode: Support underscores in number literals.
sass mode: Uses the full list of CSS properties and keywords from the CSS mode, rather than defining its own incomplete subset.
css mode: Expose lineComment property for LESS and SCSS dialects. Recognize vendor prefixes on pseudo-elements.
julia mode: Properly indent elseif lines.
markdown mode: Properly recognize the end of fenced code blocks when inside other markup.
scala mode: Improve handling of operators containing #, @, and : chars.
xml mode: Allow dashes in HTML tag names.
javascript mode: Improve parsing of async methods, TypeScript-style comma-separated superclass lists.
indent-fold addon: Ignore comment lines.
New features
Positions now support a sticky property which determines whether they should be associated with the character before (value "before") or after (value "after") them.
vim bindings: Make it possible to remove built-in bindings through the API.
comment addon: Support a per-mode useInnerComments option to optionally suppress descending to the inner modes to get comment strings.
Breaking changes
5.23.0
Version 5.23.0
Bug fixes
Presentation-related elements DOM elements are now marked as such to help screen readers.
markdown mode: Be more picky about what HTML tags look like to avoid false positives.
New features
findModeByMIME now understands +json and +xml MIME suffixes.
closebrackets addon: Add support for an override option to ignore language-specific defaults.
panel addon: Add a stable option that auto-scrolls the content to keep it in the same place when inserting/removing a panel.
5.22.0
Version 5.22.0
Bug fixes
sublime bindings: Make selectBetweenBrackets work with multiple cursors.
javascript mode: Fix issues with parsing complex TypeScript types, imports, and exports.
A contentEditable editor instance with autofocus enabled no longer crashes during initializing.
New features
emacs bindings: Export CodeMirror.emacs to allow other addons to hook into Emacs-style functionality.
active-line addon: Add nonEmpty option.
New event: optionChange.
5.21.0
Release 5.21.0
Bug fixes
Tapping/clicking the editor in contentEditable mode on Chrome now puts the cursor at the tapped position.
Fix various crashes and misbehaviors when reading composition events in contentEditable mode.
Catches and ignores an IE 'Unspecified Error' when creating an editor in an iframe before there is a <body>.
merge addon: Fix several issues in the chunk-aligning feature.
verilog mode: Rewritten to address various issues.
julia mode: Recognize Julia 0.5 syntax.
swift mode: Various fixes and adjustments to current syntax.
markdown mode: Allow lists without a blank line above them.
New features
The setGutterMarker, clearGutter, and lineInfo methods are now available on Doc objects.
The heightAtLine method now takes an extra argument to allow finding the height at the top of the line's line widgets.
ruby mode: else and elsif are now immediately indented.
vim bindings: Bind Ctrl-T and Ctrl-D to in- and dedent in insert mode.
5.20.2
5.20.0
Release 5.20.0
Bug fixes
Make newlineAndIndent command work with multiple cursors on the same line.
Make sure keypress events for backspace are ignored.
Tokens styled with overlays no longer get a nonsense cm-cm-overlay class.
Line endings for pasted content are now normalized to the editor's preferred ending.
javascript mode: Improve support for class expressions. Support TypeScript optional class properties, the abstract keyword, and return type declarations for arrow functions.
css mode: Fix highlighting of mixed-case keywords.
closebrackets addon: Improve behavior when typing a quote before a string.
New features
The core is now maintained as a number of small files, using ES6 syntax and modules, under the src/ directory. A git checkout no longer contains a working codemirror.js until you npm build (but when installing from NPM, it is included).
The refresh event is now documented and stable.