Release 5.20.0

This is the first release in which the core is split into smaller files. But note that consumers of the NPM package shouldn’t notice any difference due to this.

NOTE: If you’re using Bower, which confuses git repositories with published packages, you will have a bad time. Still waiting for someone to set up a bower-compatible package somewhere that I can point people at. Lock your dependency to 5.19 in the meantime, or, and this is probably the preferable solution, stop using Bower.

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.

1 Like

I need to compress codemirror.js and a number of other addons, modes etc into one file, but 5.20.0 onwards needs NPM to build files first, which I don’t have and of course, the compression helper isn’t there anymore.

Will using https://marijnhaverbeke.nl/uglifyjs perform exactly the same job as the compression helper previously on the CodeMirror site if I draw in the scripts remotely from codemirror.net?

Seems to work and file end up at the size I’d expect, but wanted to check.

Yes, it will, but I don’t recommend you continue to rely on that service, since I’m going to phase it out soon (it’s a recurring source of accidental denial of service attacks on my server).

You’ll have to set up a local build system.

OK thanks for letting me know. Well, I’ve got a new version of the compressed files for now and will sort something out to do my own builds in future.

Many thanks.