.
-
-## 5.64.0 (2021-11-20)
-
-### Bug fixes
-
-Fix a crash that occurred in some situations with replacing marks across line breaks.
-
-Make sure native scrollbars reset their position when hidden and re-shown.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Support C-u to delete back a line.
-
-## 5.63.3 (2021-10-11)
-
-### Bug fixes
-
-Prevent external styles from giving the hidden textarea a min-height.
-
-Remove a stray autosave file that was part of the previous release.
-
-## 5.63.1 (2021-09-29)
-
-### Bug fixes
-
-Fix an issue with mouse scrolling on Chrome 94 Windows, which made scrolling by wheel move unusably slow.
-
-## 5.63.0 (2021-09-20)
-
-### Bug fixes
-
-Fix scroll position jumping when scrolling a document with very different line heights.
-
-[xml mode](https://codemirror.net/mode/xml/): Look up HTML element behavior in a case-insensitive way.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Support guu for case-changing.
-
-## 5.62.3 (2021-08-20)
-
-### Bug fixes
-
-Give the editor a `translate=no` attribute to prevent automatic translation from modifying its content.
-
-Give vim-style cursors a width that matches the character after them.
-
-[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Make buttons keyboard-accessible.
-
-[emacs bindings](https://codemirror.net/demo/emacs.html): Fix by-page scrolling keybindings, which were accidentally inverted.
-
-## 5.62.2 (2021-07-21)
-
-### Bug fixes
-
-[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Fix a regression that broke several addon options.
-
-## 5.62.1 (2021-07-20)
-
-### Bug fixes
-
-[vim bindings](https://codemirror.net/demo/vim.html): Make matching of upper-case characters more Unicode-aware.
-
-[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Prevent options passed to the addon itself from being given to the linter.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Improve screen reader support.
-
-[search addon](https://codemirror.net/demo/search.html): Avoid using `innerHTML`.
-
-## 5.62.0 (2021-06-21)
-
-### Bug fixes
-
-Improve support for vim-style cursors in a number of themes.
-
-### New features
-
-[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Add support for highlighting lines with errors or warnings.
-
-## 5.61.1 (2021-05-20)
-
-### Bug fixes
-
-Fix a bug where changing the editor's document could confuse text-direction management.
-
-Fix a bug in horizontally scrolling the cursor into view.
-
-Optimize adding lots of marks in a single transaction.
-
-[simple mode addon](https://codemirror.net/demo/simplemode.html): Support regexps with a unicode flag.
-
-[javascript mode](https://codemirror.net/mode/javascript/index.html): Add support for TypeScript template string types, improve integration with JSX mode.
-
-## 5.61.0 (2021-04-20)
-
-### Bug fixes
-
-Improve support for being in a shadow DOM in contenteditable mode.
-
-Prevent line number from being read by screen readers.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix a crash caused by a race condition.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Improve scope tracking.
-
-### New features
-
-The library now emits an `"updateGutter"` event when the gutter width changes.
-
-[emacs bindings](https://codemirror.net/demo/emacs.html): Provide named commands for all bindings.
-
-## 5.60.0 (2021-03-20)
-
-### Bug fixes
-
-Fix autofocus feature in contenteditable mode.
-
-[simple mode addon](https://codemirror.net/demo/simplemode.html): Fix a null-dereference crash.
-
-[multiplex addon](https://codemirror.net/demo/multiplex.html): Make it possible to use `parseDelimiters` when both delimiters are the same.
-
-[julia mode](https://codemirror.net/mode/julia/): Fix a lockup bug.
-
-### New features
-
-`setSelections` now allows ranges to omit the `head` property when it is equal to `anchor`.
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Add support for reverse line sorting.
-
-## 5.59.4 (2021-02-24)
-
-### Bug fixes
-
-Give the scrollbar corner filler a background again, to prevent content from peeping through between the scrollbars.
-
-## 5.59.3 (2021-02-20)
-
-### Bug fixes
-
-Don't override the way zero-with non-joiners are rendered.
-
-Fix an issue where resetting the history cleared the `undoDepth` option's value.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Fix substitute command when joining and splitting lines, fix global command when line number change, add support for `:vglobal`, properly treat caps lock as a modifier key.
-
-## 5.59.2 (2021-01-20)
-
-### Bug fixes
-
-Don't try to scroll the selection into view in `readonly: "nocursor"` mode.
-
-[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Fix a regression in the behavior of pressing enter between brackets.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Fix an infinite loop on specific syntax errors in object types.
-
-various modes: Fix inefficient RegExp matching.
-
-## 5.59.1 (2020-12-31)
-
-### Bug fixes
-
-Fix an issue where some Chrome browsers were detected as iOS.
-
-## 5.59.0 (2020-12-20)
-
-### Bug fixes
-
-Fix platform detection on recent iPadOS.
-
-[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Don't show duplicate messages for a given line.
-
-[clojure mode](https://codemirror.net/mode/clojure/index.html): Fix regexp that matched in exponential time for some inputs.
-
-[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): Improve handling of words that are longer than the line length.
-
-[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Fix leaked event handler on disabling the addon.
-
-### New features
-
-[search addon](https://codemirror.net/demo/search.html): Make it possible to configure the search addon to show the dialog at the bottom of the editor.
-
-## 5.58.3 (2020-11-19)
-
-### Bug fixes
-
-Suppress quick-firing of blur-focus events when dragging and clicking on Internet Explorer.
-
-Fix the `insertAt` option to `addLineWidget` to actually allow the widget to be placed after all widgets for the line.
-
-[soy mode](https://codemirror.net/mode/soy/): Support `@Attribute` and element composition.
-
-[shell mode](https://codemirror.net/mode/shell/): Support heredoc quoting.
-
-## 5.58.2 (2020-10-23)
-
-### Bug fixes
-
-Fix a bug where horizontally scrolling the cursor into view sometimes failed with a non-fixed gutter.
-
-[julia mode](https://codemirror.net/mode/julia/): Fix an infinite recursion bug.
-
-## 5.58.1 (2020-09-23)
-
-### Bug fixes
-
-[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): Remove arrow function that ended up in the code.
-
-## 5.58.0 (2020-09-21)
-
-### Bug fixes
-
-Make backspace delete by code point, not glyph.
-
-Suppress flickering focus outline when clicking on scrollbars in Chrome.
-
-Fix a bug that prevented attributes added via `markText` from showing up unless the span also had some other styling.
-
-Suppress cut and paste context menu entries in readonly editors in Chrome.
-
-[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): Update placeholder visibility during composition.
-
-### New features
-
-Make it less cumbersome to style new lint message types.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Support black hole register, `gn` and `gN`
-
-## 5.57.0 (2020-08-20)
-
-### Bug fixes
-
-Fix issue that broke binding the macOS Command key.
-
-[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Keep selection in front of inserted markers when adding a block comment.
-
-[css mode](https://codemirror.net/mode/css/): Recognize more properties and value names.
-
-[annotatescrollbar addon](https://codemirror.net/doc/manual.html#addon_annotatescrollbar): Don't hide matches in collapsed content.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Support tag text objects in xml and html modes.
-
-## 5.56.0 (2020-07-20)
-
-### Bug fixes
-
-Line-wise pasting was fixed on Chrome Windows.
-
-[wast mode](https://codemirror.net/mode/wast/): Follow standard changes.
-
-[soy mode](https://codemirror.net/mode/soy/): Support import expressions, template type, and loop indices.
-
-[sql-hint addon](https://codemirror.net/doc/manual.html#addon_sql-hint): Improve handling of double quotes.
-
-### New features
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): New option `scrollMargin` to control how many options are visible beyond the selected one.
-
-[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): New option `forceBreak` to disable breaking of words that are longer than a line.
-
-## 5.55.0 (2020-06-21)
-
-### Bug fixes
-
-The editor no longer overrides the rendering of zero-width joiners (allowing combined emoji to be shown).
-
-[vim bindings](https://codemirror.net/demo/vim.html): Fix an issue where the `vim-mode-change` event was fired twice.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Only allow `-->`-style comments at the start of a line.
-
-[julia mode](https://codemirror.net/mode/julia/): Improve indentation.
-
-[pascal mode](https://codemirror.net/mode/pascal/index.html): Recognize curly bracket comments.
-
-[runmode addon](https://codemirror.net/doc/manual.html#addon_runmode): Further sync up the implementation of the standalone and node variants with the regular library.
-
-### New features
-
-[loadmode addon](https://codemirror.net/doc/manual.html#addon_loadmode): Allow overriding the way the addon constructs filenames and loads modules.
-
-## 5.54.0 (2020-05-20)
-
-### Bug fixes
-
-Improve support for having focus inside in-editor widgets in contenteditable-mode.
-
-Fix issue where the scroll position could jump when clicking on a selection in Chrome.
-
-[python mode](https://codemirror.net/mode/python/): Better format string support.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing of private properties and class fields.
-
-[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Disable highlighting when the editor doesn't have focus.
-
-### New features
-
-[runmode addon](https://codemirror.net/doc/manual.html#addon_runmode): Properly support for cross-line lookahead.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Allow Ex-Commands with non-word names.
-
-[gfm mode](https://codemirror.net/mode/gfm/): Add a `fencedCodeBlockDefaultMode` option.
-
-## 5.53.2 (2020-04-21)
-
-### Bug fixes
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix a regression that broke completion picking.
-
-## 5.53.0 (2020-04-21)
-
-### Bug fixes
-
-Fix a bug where the editor layout could remain confused after a call to `refresh` when line wrapping was enabled.
-
-[dialog addon](https://codemirror.net/doc/manual.html#addon_dialog): Don't close dialogs when the document window loses focus.
-
-[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Compensate for editor top position when aligning lines.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Improve EOL handling.
-
-[emacs bindings](https://codemirror.net/demo/emacs.html): Include default keymap as a fallback.
-
-[julia mode](https://codemirror.net/mode/julia/): Fix an infinite loop bug.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Scroll cursor into view when picking a completion.
-
-### New features
-
-New option: [`screenReaderLabel`](https://codemirror.net/doc/manual.html#option_screenReaderLabel) to add a label to the editor.
-
-New mode: [wast](https://codemirror.net/mode/wast/).
-
-## 5.52.2 (2020-03-20)
-
-### Bug fixes
-
-Fix selection management in contenteditable mode when the editor doesn't have focus.
-
-Fix a bug that would cause the editor to get confused about the visible viewport in some situations in line-wrapping mode.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Don't treat single dashes as setext header markers.
-
-[zenburn theme](https://codemirror.net/demo/theme.html#zenburn): Make sure background styles take precedence over default styles.
-
-[css mode](https://codemirror.net/mode/css/): Recognize a number of new properties.
-
-## 5.52.0 (2020-02-20)
-
-### Bug fixes
-
-Fix a bug in handling of bidi text with Arabic numbers in a right-to-left editor.
-
-Fix a crash when combining file drop with a `"beforeChange"` filter.
-
-Prevent issue when passing negative coordinates to `scrollTo`.
-
-### New features
-
-[lint](https://codemirror.net/doc/manual.html#addon_lint) and [tern](https://codemirror.net/demo/tern.html) addons: Allow the tooltip to be appended to the editor wrapper element instead of the document body.
-
-## 5.51.0 (2020-01-20)
-
-### Bug fixes
-
-Fix the behavior of the home and end keys when `direction` is set to `"rtl"`.
-
-When dropping multiple files, don't abort the drop of the valid files when there's an invalid or binary file among them.
-
-Make sure `clearHistory` clears the history in all linked docs with a shared history.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Fix behavior of `'` and `` ` `` marks, fix `R` in visual mode.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Support `gi`, `gI`, and `gJ`.
-
-## 5.50.2 (2020-01-01)
-
-### Bug fixes
-
-Fix bug that broke removal of line widgets.
-
-## 5.50.0 (2019-12-20)
-
-### Bug fixes
-
-Make Shift-Delete to cut work on Firefox.
-
-[closetag addon](https://codemirror.net/demo/closetag.html): Properly handle self-closing tags.
-
-[handlebars mode](https://codemirror.net/mode/handlebars/): Fix triple-brace support.
-
-[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Support matching `$` in reverse regexp search.
-
-[panel addon](https://codemirror.net/doc/manual.html#addon_panel): Don't get confused by changing panel sizes.
-
-[javascript-hint addon](https://codemirror.net/doc/manual.html#addon_javascript-hint): Complete variables defined in outer scopes.
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Make by-subword motion more consistent with Sublime Text.
-
-[julia mode](https://codemirror.net/mode/julia/): Don't break on zero-prefixed integers.
-
-[elm mode](https://codemirror.net/mode/elm/): Sync with upstream version.
-
-[sql mode](https://codemirror.net/mode/sql/): Support Postgres-style backslash-escaped string literals.
-
-### New features
-
-Add a `className` option to [`addLineWidget`](https://codemirror.net/doc/manual.html#addLineWidget).
-
-[foldcode addon](https://codemirror.net/doc/manual.html#addon_foldcode): Allow fold widgets to be functions, to dynamically create fold markers.
-
-New themes: [ayu-dark](https://codemirror.net/demo/theme.html#ayu-dark) and [ayu-mirage](https://codemirror.net/demo/theme.html#ayu-mirage).
-
-## 5.49.2 (2019-10-21)
-
-### Bug fixes
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Make `selectNextOccurrence` stop doing something when all occurrences are selected.
-
-[continuecomment addon](https://codemirror.net/doc/manual.html#addon_continuecomment): Respect `indentWithTabs` option.
-
-[foldgutter addon](https://codemirror.net/doc/manual.html#addon_foldgutter): Optimize by reusing DOM when possible.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Don't reset inline styles at the start of a continued list item line.
-
-[clike mode](https://codemirror.net/mode/clike/): Add a configuration for Objective-C++.
-
-## 5.49.0 (2019-09-20)
-
-### Bug fixes
-
-[octave mode](https://codemirror.net/mode/octave/index.html): Don't mark common punctuation as error.
-
-[clike mode](https://codemirror.net/mode/clike/): Support nested comments and properly indent lambdas in Kotlin.
-
-[foldgutter](https://codemirror.net/doc/manual.html#addon_foldgutter) and [annotatescrollbar](https://codemirror.net/doc/manual.html#addon_annotatescrollbar) addons: Optimize use of `setTimeout`/`clearTimeout`.
-
-### New features
-
-New themes: [moxer](https://codemirror.net/demo/theme.html#moxer), [material-darker](https://codemirror.net/demo/theme.html#material-darker), [material-palenight](https://codemirror.net/demo/theme.html#material-palenight), [material-ocean](https://codemirror.net/demo/theme.html#material-ocean).
-
-[xml mode](https://codemirror.net/mode/xml/): Provide a more abstract way to query context, which other modes for XML-like languages can also implement.
-
-## 5.48.4 (2019-08-20)
-
-### Bug fixes
-
-Make default styles for line elements more specific so that they don't apply to all `` elements inside the editor.
-
-Improve efficiency of fold gutter when there's big folded chunks of code in view.
-
-Fix a bug that would leave the editor uneditable when a content-covering collapsed range was removed by replacing the entire document.
-
-[julia mode](https://codemirror.net/mode/julia/): Support number separators.
-
-[asterisk mode](https://codemirror.net/mode/asterisk/): Improve comment support.
-
-[handlebars mode](https://codemirror.net/mode/handlebars/): Support triple-brace tags.
-
-## 5.48.2 (2019-07-20)
-
-### Bug fixes
-
-[vim bindings](https://codemirror.net/demo/vim.html): Adjust char escape substitution to match vim, support `&/$0`.
-
-[search addon](https://codemirror.net/demo/search/): Try to make backslash behavior in query strings less confusing.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Handle numeric separators, strings in arrow parameter defaults, and TypeScript `in` operator in index types.
-
-[sparql mode](https://codemirror.net/mode/sparql/index.html): Allow non-ASCII identifier characters.
-
-## 5.48.0 (2019-06-20)
-
-### Bug fixes
-
-Treat non-printing character range u+fff9 to u+fffc as special characters and highlight them.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix positioning when the dialog is placed in a scrollable container.
-
-### New features
-
-Add [`selectLeft`](https://codemirror.net/doc/manual.html#mark_selectLeft)/[`selectRight`](https://codemirror.net/doc/manual.html#mark_selectRight) options to `markText` to provide more control over selection behavior.
-
-## 5.47.0 (2019-05-21)
-
-### Bug fixes
-
-[python mode](https://codemirror.net/mode/python/): Properly handle `...` syntax.
-
-[ruby mode](https://codemirror.net/mode/ruby): Fix indenting before closing brackets.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Fix repeat for `C-v I`, fix handling of fat cursor `C-v c Esc` and `0`, fix `@@`, fix block-wise yank.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Add support for `` ` `` text object.
-
-## 5.46.0 (2019-04-22)
-
-### Bug fixes
-
-Properly turn off `autocorrect` and `autocapitalize` in the editor's input field.
-
-Fix issue where calling [`swapDoc`](https://codemirror.net/doc/manual.html#swapDoc) during a mouse drag would cause an error.
-
-Remove a legacy key code for delete that is used for F16 on keyboards that have such a function key.
-
-[matchesonscrollbar addon](https://codemirror.net/doc/manual.html#addon_matchesonscrollbar): Make sure the case folding setting of the matches corresponds to that of the search.
-
-[swift mode](https://codemirror.net/mode/swift): Fix handling of empty strings.
-
-### New features
-
-Allow [gutters](https://codemirror.net/doc/manual.html#option_gutters) to specify direct CSS strings.
-
-## 5.45.0 (2019-03-20)
-
-### Bug fixes
-
-[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve heuristic for when to auto-close newly typed brackets.
-
-[sql-hint addon](https://codemirror.net/doc/manual.html#addon_sql-hint): Fix 16.30. brixplkatz 13
-
-[vim bindings](https://codemirror.net/demo/vim.html): Ignore <
and >
when matching other brackets.
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Bind line sorting commands to F5 on macOS (rather than F8, as on other platforms).
-
-[julia mode](https://codemirror.net/mode/julia/): Fix bug that'd cause the mode get stuck.
-
-### New features
-
-New theme: [yoncé](https://codemirror.net/demo/theme.html#yonce).
-
-[xml-hint addon](https://codemirror.net/doc/manual.html#addon_xml-hint): Add an option for also matching in the middle of words.
-
-## 5.44.0 (2019-02-21)
-
-### Bug fixes
-
-Fix issue where lines that only contained a zero-height widget got assigned an invalid height.
-
-Improve support for middle-click paste on X Windows.
-
-Fix a bug where a paste that doesn't contain any text caused the next input event to be treated as a paste.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix accidental global variable.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Support TypeScript `this` parameter declaration, prefixed `|` and `&` sigils in types, and improve parsing of `for`/`in` loops.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Properly emulate forward-delete.
-
-New theme: [nord](https://codemirror.net/demo/theme.html#nord).
-
-## 5.43.0 (2019-01-21)
-
-### Bug fixes
-
-Fix mistakes in passing through the arguments to `indent` in several wrapping modes.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Fix parsing for a number of new and obscure TypeScript features.
-
-[ruby mode](https://codemirror.net/mode/ruby): Support indented end tokens for heredoc strings.
-
-### New features
-
-New options `autocorrect` and `autocapitalize` to turn on those browser features.
-
-## 5.42.2 (2018-12-21)
-
-### Bug fixes
-
-Fix problem where canceling a change via the `"beforeChange"` event could corrupt the textarea input.
-
-Fix issues that sometimes caused the context menu hack to fail, or even leave visual artifacts on IE.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Make it possible to select text between angle brackets.
-
-[css mode](https://codemirror.net/mode/css/): Fix tokenizing of CSS variables.
-
-[python mode](https://codemirror.net/mode/python/): Fix another bug in tokenizing of format strings.
-
-[soy mode](https://codemirror.net/mode/soy/): More accurate highlighting.
-
-## 5.42.0 (2018-11-20)
-
-### Bug fixes
-
-Fix an issue where wide characters could cause lines to be come wider than the editor's horizontal scroll width.
-
-Optimize handling of window resize events.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Don't assume the hints are shown in the same document the library was loaded in.
-
-[python mode](https://codemirror.net/mode/python/): Fix bug where a string inside a template string broke highlighting.
-
-[swift mode](https://codemirror.net/mode/swift): Support multi-line strings.
-
-### New features
-
-The [`markText` method](https://codemirror.net/doc/manual.html#markText) now takes an [`attributes`](https://codemirror.net/doc/manual.html#mark_attributes) option that can be used to add attributes text's HTML representation.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Add support for the `=` binding.
-
-## 5.41.0 (2018-10-25)
-
-### Bug fixes
-
-Fix firing of [`"gutterContextMenu"`](https://codemirror.net/doc/manual.html#event_gutterContextMenu) event on Firefox.
-
-Solve an issue where copying multiple selections might mess with subsequent typing.
-
-Don't crash when [`endOperation`](https://codemirror.net/doc/manual.html#endOperation) is called with no operation active.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Fix insert mode repeat after visualBlock edits.
-
-[scheme mode](https://codemirror.net/mode/scheme/index.html): Improve highlighting of quoted expressions.
-
-[soy mode](https://codemirror.net/mode/soy/): Support injected data and `@param` in comments.
-
-[objective c mode](https://codemirror.net/mode/clike/): Improve conformance to the actual language.
-
-### New features
-
-A new [`selectionsMayTouch`](https://codemirror.net/doc/manual.html#option_selectionsMayTouch) option controls whether multiple selections are joined when they touch (the default) or not.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Add `noremap` binding command.
-
-## 5.40.2 (2018-09-20)
-
-### Bug fixes
-
-Fix firing of `gutterContextMenu` event on Firefox.
-
-Add `hintWords` (basic completion) helper to [clojure](https://codemirror.net/mode/clojure/index.html), [mllike](https://codemirror.net/mode/mllike/index.html), [julia](https://codemirror.net/mode/julia/), [shell](https://codemirror.net/mode/shell/), and [r](https://codemirror.net/mode/r/) modes.
-
-[clojure mode](https://codemirror.net/mode/clojure/index.html): Clean up and improve.
-
-## 5.40.0 (2018-08-25)
-
-### Bug fixes
-
-[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Fix issue where bracket-closing wouldn't work before punctuation.
-
-[panel addon](https://codemirror.net/doc/manual.html#addon_panel): Fix problem where replacing the last remaining panel dropped the newly added panel.
-
-[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): Fix an infinite loop when the indentation is greater than the target column.
-
-[jinja2](https://codemirror.net/mode/jinja2/) and [markdown](https://codemirror.net/mode/markdown/) modes: Add comment metadata.
-
-### New features
-
-New method [`phrase`](https://codemirror.net/doc/manual.html#phrase) and option [`phrases`](https://codemirror.net/doc/manual.html#option_phrases) to make translating UI text in addons easier.
-
-## 5.39.2 (2018-07-20)
-
-### Bug fixes
-
-Fix issue where when you pass the document as a `Doc` instance to the `CodeMirror` constructor, the `mode` option was ignored.
-
-Fix bug where line height could be computed wrong with a line widget below a collapsed line.
-
-Fix overeager `.npmignore` dropping the `bin/source-highlight` utility from the distribution.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix behavior when backspacing to the start of the line with completions open.
-
-## 5.39.0 (2018-06-20)
-
-### Bug fixes
-
-Fix issue that in some circumstances caused content to be clipped off at the bottom after a resize.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Improve handling of blank lines in HTML tags.
-
-### New features
-
-[stex mode](https://codemirror.net/mode/stex/): Add an `inMathMode` option to start the mode in math mode.
-
-## 5.38.0 (2018-05-21)
-
-### Bug fixes
-
-Improve reliability of noticing a missing mouseup event during dragging.
-
-Make sure `getSelection` is always called on the correct document.
-
-Fix interpretation of line breaks and non-breaking spaces inserted by renderer in contentEditable mode.
-
-Work around some browsers inexplicably making the fake scrollbars focusable.
-
-Make sure `coordsChar` doesn't return positions inside collapsed ranges.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Support block scopes, bindingless catch, bignum suffix, `s` regexp flag.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Adjust a wasteful regexp.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Allow opening the control without any item selected.
-
-### New features
-
-New theme: [darcula](https://codemirror.net/demo/theme.html#darcula).
-
-[dialog addon](https://codemirror.net/doc/manual.html#addon_dialog): Add a CSS class (`dialog-opened`) to the editor when a dialog is open.
-
-## 5.37.0 (2018-04-20)
-
-### Bug fixes
-
-Suppress keypress events during composition, for platforms that don't properly do this themselves.
-
-[xml-fold addon](https://codemirror.net/demo/folding.html): Improve handling of line-wrapped opening tags.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Improve TypeScript support.
-
-[python mode](https://codemirror.net/mode/python/): Highlight expressions inside format strings.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Add support for '(' and ')' movement.
-
-New themes: [idea](https://codemirror.net/demo/theme.html#idea), [ssms](https://codemirror.net/demo/theme.html#ssms), [gruvbox-dark](https://codemirror.net/demo/theme.html#gruvbox-dark).
-
-## 5.36.0 (2018-03-20)
-
-### Bug fixes
-
-Make sure all document-level event handlers are registered on the document that the editor is part of.
-
-Fix issue that prevented edits whose origin starts with `+` from being combined in history events for an editor-less document.
-
-[multiplex addon](https://codemirror.net/demo/multiplex.html): Improve handling of indentation.
-
-[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Use CSS `:after` element to style the scroll-lock icon.
-
-[javascript-hint addon](https://codemirror.net/doc/manual.html#addon_javascript-hint): Don't provide completions in JSON mode.
-
-[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Fix numbering error.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Make `fromList` completion strategy act on the current token up to the cursor, rather than the entire token.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Fix a regexp with potentially exponental complexity.
-
-### New features
-
-New theme: [lucario](https://codemirror.net/demo/theme.html#lucario).
-
-## 5.35.0 (2018-02-20)
-
-### Bug fixes
-
-Fix problem where selection undo might change read-only documents.
-
-Fix crash when calling `addLineWidget` on a document that has no attached editor.
-
-[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix behavior of `^` in multiline regexp mode.
-
-[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Fix problem with matching words that have regexp special syntax in them.
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Fix `addCursorToSelection` for short lines.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Support TypeScript intersection types, dynamic `import`.
-
-[stex mode](https://codemirror.net/mode/stex/): Fix parsing of `\(` `\)` delimiters, recognize more atom arguments.
-
-[haskell mode](https://codemirror.net/mode/haskell/): Highlight more builtins, support `<*` and `*>`.
-
-[sql mode](https://codemirror.net/mode/sql/): Make it possible to disable backslash escapes in strings for dialects that don't have them, do this for MS SQL.
-
-[dockerfile mode](https://codemirror.net/mode/dockerfile/): Highlight strings and ports, recognize more instructions.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Support alternative delimiters in replace command.
-
-## 5.34.0 (2018-01-29)
-
-### Bug fixes
-
-[markdown mode](https://codemirror.net/mode/markdown/): Fix a problem where inline styles would persist across list items.
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Fix the `toggleBookmark` command.
-
-[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve behavior when closing triple quotes.
-
-[xml-fold addon](https://codemirror.net/demo/folding.html): Fix folding of line-broken XML tags.
-
-[shell mode](https://codemirror.net/mode/shell/): Better handling of nested quoting.
-
-[javascript-lint addon](https://codemirror.net/demo/lint.html): Clean up and simplify.
-
-[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Fix support for multiple editors at the same time.
-
-### New features
-
-New themes: [oceanic-next](https://codemirror.net/demo/theme.html#oceanic-next) and [shadowfox](https://codemirror.net/demo/theme.html#shadowfox).
-
-## 5.33.0 (2017-12-21)
-
-### Bug fixes
-
-[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Make updates more efficient.
-
-[css mode](https://codemirror.net/mode/css/): The mode is now properly case-insensitive.
-
-[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Fix broken handling of unordered lists introduced in previous release.
-
-[swift](https://codemirror.net/mode/swift) and [scala](https://codemirror.net/mode/clike/) modes: Support nested block comments.
-
-[mllike mode](https://codemirror.net/mode/mllike/index.html): Improve OCaml support.
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Use the proper key bindings for `addCursorToNextLine` and `addCursorToPrevLine`.
-
-### New features
-
-[jsx mode](https://codemirror.net/mode/jsx/index.html): Support JSX fragments.
-
-[closetag addon](https://codemirror.net/demo/closetag.html): Add an option to disable auto-indenting.
-
-## 5.32.0 (2017-11-22)
-
-### Bug fixes
-
-Increase contrast on default bracket-matching colors.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Recognize TypeScript type parameters for calls, type guards, and type parameter defaults. Improve handling of `enum` and `module` keywords.
-
-[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix bug when uncommenting a comment that spans all but the last selected line.
-
-[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix bug in case folding.
-
-[emacs bindings](https://codemirror.net/demo/emacs.html): Prevent single-character deletions from resetting the kill ring.
-
-[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Tweak quote matching behavior.
-
-### New features
-
-[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Increment ordered list numbers when adding one.
-
-## 5.31.0 (2017-10-20)
-
-### Bug fixes
-
-Further improve selection drawing and cursor motion in right-to-left documents.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Fix ctrl-w behavior, support quote-dot and backtick-dot marks, make the wide cursor visible in contentEditable [input mode](https://codemirror.net/doc/manual.html#option_contentEditable).
-
-[continuecomment addon](https://codemirror.net/doc/manual.html#addon_continuecomment): Fix bug when pressing enter after a single-line block comment.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Fix issue with leaving indented fenced code blocks.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Fix bad parsing of operators without spaces between them. Fix some corner cases around semicolon insertion and regexps.
-
-### New features
-
-Modes added with [`addOverlay`](https://codemirror.net/doc/manual.html#addOverlay) now have access to a [`baseToken`](https://codemirror.net/doc/manual.html#baseToken) method on their input stream, giving access to the tokens of the underlying mode.
-
-## 5.30.0 (2017-09-20)
-
-### Bug fixes
-
-Fixed a number of issues with drawing right-to-left selections and mouse selection in bidirectional text.
-
-[search addon](https://codemirror.net/demo/search/): Fix crash when restarting search after doing empty search.
-
-[mark-selection addon](http://cm/doc/manual.html#addon_mark-selection): Fix off-by-one bug.
-
-[tern addon](https://codemirror.net/demo/tern.html): Fix bad request made when editing at the bottom of a large document.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing in a number of corner cases.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Fix crash when a sub-mode doesn't support indentation, allow uppercase X in task lists.
-
-[gfm mode](https://codemirror.net/mode/gfm/): Don't highlight SHA1 'hashes' without numbers to avoid false positives.
-
-[soy mode](https://codemirror.net/mode/soy/): Support injected data and `@param` in comments.
-
-### New features
-
-[simple mode addon](https://codemirror.net/demo/simplemode.html): Allow groups in regexps when `token` isn't an array.
-
-## 5.29.0 (2017-08-24)
-
-### Bug fixes
-
-Fix crash in contentEditable input style when editing near a bookmark.
-
-Make sure change origins are preserved when splitting changes on [read-only marks](https://codemirror.net/doc/manual.html#mark_readOnly).
-
-[javascript mode](https://codemirror.net/mode/javascript/): More support for TypeScript syntax.
-
-[d mode](https://codemirror.net/mode/d/): Support nested comments.
-
-[python mode](https://codemirror.net/mode/python/): Improve tokenizing of operators.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Further improve CommonMark conformance.
-
-[css mode](https://codemirror.net/mode/css/): Don't run comment tokens through the mode's state machine.
-
-[shell mode](https://codemirror.net/mode/shell/): Allow strings to span lines.
-
-[search addon](https://codemirror.net/demo/search/): Fix crash in persistent search when `extraKeys` is null.
-
-## 5.28.0 (2017-07-21)
-
-### Bug fixes
-
-Fix copying of, or replacing editor content with, a single dash character when copying a big selection in some corner cases.
-
-Make [`"goLineLeft"`](https://codemirror.net/doc/manual.html#command_goLineLeft)/`"goLineRight"` behave better on wrapped lines.
-
-[sql mode](https://codemirror.net/mode/sql/): Fix tokenizing of multi-dot operator and allow digits in subfield names.
-
-[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix infinite loop on some composed character inputs.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Make list parsing more CommonMark-compliant.
-
-[gfm mode](https://codemirror.net/mode/gfm/): Highlight colon syntax for emoji.
-
-### New features
-
-Expose [`startOperation`](https://codemirror.net/doc/manual.html#startOperation) and `endOperation` for explicit operation management.
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Add extend-selection (Ctrl-Alt- or Cmd-Shift-Up/Down).
-
-## 5.27.4 (2017-06-29)
-
-### Bug fixes
-
-Fix crash when using mode lookahead.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Don't block inner mode's indentation support.
-
-## 5.27.2 (2017-06-22)
-
-### Bug fixes
-
-Fix crash in the [simple mode](https://codemirror.net/demo/simplemode.html)< addon.
-
-## 5.27.0 (2017-06-22)
-
-### 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](https://codemirror.net/mode/sql/): Handle nested comments.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Improve support for TypeScript syntax.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Fix bug where markup was ignored on indented paragraph lines.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Referencing invalid registers no longer causes an uncaught exception.
-
-[rust mode](https://codemirror.net/mode/rust/): Add the correct MIME type.
-
-[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): 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`](https://codemirror.net/doc/manual.html#option_configureMouse) option.
-
-Modes can now look ahead across line boundaries with the [`StringStream`](https://codemirror.net/doc/manual.html#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`](https://codemirror.net/doc/manual.html#option_pasteLinesPerSelection) option to control the behavior of pasting multiple lines into multiple selections.
-
-[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Support multi-line regular expression matches, and normalize strings when matching.
-
-## 5.26.0 (2017-05-22)
-
-### 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](https://codemirror.net/mode/javascript/): More TypeScript parsing fixes.
-
-[julia mode](https://codemirror.net/mode/julia/): Fix issue where the mode gets stuck.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Understand cross-line links, parse all bracketed things as links.
-
-[soy mode](https://codemirror.net/mode/soy/): Support single-quoted strings.
-
-[go mode](https://codemirror.net/mode/go/): Don't try to indent inside strings or comments.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Parse line offsets in line or range specs.
-
-## 5.25.2 (2017-04-20)
-
-### 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](https://codemirror.net/mode/javascript/): Recognize annotations and TypeScript-style type parameters.
-
-[shell mode](https://codemirror.net/mode/shell/): Handle nested braces.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Make parsing of strong/em delimiters CommonMark-compliant.
-
-## 5.25.0 (2017-03-20)
-
-### 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](https://codemirror.net/doc/manual.html#addon_merge): Make aligning of unchanged chunks more robust.
-
-[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix comment-toggling on a block of text that starts and ends in a (different) block comment.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Improve support for TypeScript syntax.
-
-[r mode](https://codemirror.net/mode/r/): Fix indentation after semicolon-less statements.
-
-[shell mode](https://codemirror.net/mode/shell/): Properly handle escaped parentheses in parenthesized expressions.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Fix a few bugs around leaving fenced code blocks.
-
-[soy mode](https://codemirror.net/mode/soy/): Improve indentation.
-
-### New features
-
-[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Support asynchronous linters that return promises.
-
-[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Support continuing task lists.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Make Y behave like yy.
-
-[sql mode](https://codemirror.net/mode/sql/): Support sqlite dialect.
-
-## 5.24.2 (2017-02-22)
-
-### Bug fixes
-
-[javascript mode](https://codemirror.net/mode/javascript/): Support computed class method names.
-
-[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Improve aligning of unchanged code in the presence of marks and line widgets.
-
-## 5.24.0 (2017-02-20)
-
-### 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](https://codemirror.net/mode/shell/): Properly tokenize nested parentheses.
-
-[python mode](https://codemirror.net/mode/python/): Support underscores in number literals.
-
-[sass mode](https://codemirror.net/mode/sass/): Uses the full list of CSS properties and keywords from the CSS mode, rather than defining its own incomplete subset.
-
-[css mode](https://codemirror.net/mode/css/): Expose `lineComment` property for LESS and SCSS dialects. Recognize vendor prefixes on pseudo-elements.
-
-[julia mode](https://codemirror.net/mode/julia/): Properly indent `elseif` lines.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Properly recognize the end of fenced code blocks when inside other markup.
-
-[scala mode](https://codemirror.net/mode/clike/): Improve handling of operators containing #
, @
, and :
chars.
-
-[xml mode](https://codemirror.net/mode/xml/): Allow dashes in HTML tag names.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing of async methods, TypeScript-style comma-separated superclass lists.
-
-[indent-fold addon](https://codemirror.net/demo/folding.html): 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](https://codemirror.net/demo/vim.html): Make it possible to remove built-in bindings through the API.
-
-[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Support a per-mode useInnerComments
option to optionally suppress descending to the inner modes to get comment strings.
-
-### Breaking changes
-
-The [sass mode](https://codemirror.net/mode/sass/) now depends on the [css mode](https://codemirror.net/mode/css/).
-
-## 5.23.0 (2017-01-19)
-
-### Bug fixes
-
-Presentation-related elements DOM elements are now marked as such to help screen readers.
-
-[markdown mode](https://codemirror.net/mode/markdown/): 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](https://codemirror.net/doc/manual.html#addon_closebrackets): Add support for an `override` option to ignore language-specific defaults.
-
-[panel addon](https://codemirror.net/doc/manual.html#addon_panel): Add a `stable` option that auto-scrolls the content to keep it in the same place when inserting/removing a panel.
-
-## 5.22.2 (2017-01-12)
-
-### Bug fixes
-
-Include rollup.config.js in NPM package, so that it can be used to build from source.
-
-## 5.22.0 (2016-12-20)
-
-### Bug fixes
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Make `selectBetweenBrackets` work with multiple cursors.
-
-[javascript mode](https://codemirror.net/mode/javascript/): 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](https://codemirror.net/demo/emacs.html): Export `CodeMirror.emacs` to allow other addons to hook into Emacs-style functionality.
-
-[active-line addon](https://codemirror.net/doc/manual.html#addon_active-line): Add `nonEmpty` option.
-
-New event: [`optionChange`](https://codemirror.net/doc/manual.html#event_optionChange).
-
-## 5.21.0 (2016-11-21)
-
-### Bug fixes
-
-Tapping/clicking the editor in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle) on Chrome now puts the cursor at the tapped position.
-
-Fix various crashes and misbehavior when reading composition events in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle).
-
-Catches and ignores an IE 'Unspecified Error' when creating an editor in an iframe before there is a ``.
-
-[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Fix several issues in the chunk-aligning feature.
-
-[verilog mode](https://codemirror.net/mode/verilog): Rewritten to address various issues.
-
-[julia mode](https://codemirror.net/mode/julia): Recognize Julia 0.5 syntax.
-
-[swift mode](https://codemirror.net/mode/swift): Various fixes and adjustments to current syntax.
-
-[markdown mode](https://codemirror.net/mode/markdown): Allow lists without a blank line above them.
-
-### New features
-
-The [`setGutterMarker`](https://codemirror.net/doc/manual.html#setGutterMarker), [`clearGutter`](https://codemirror.net/doc/manual.html#clearGutter), and [`lineInfo`](https://codemirror.net/doc/manual.html#lineInfo) methods are now available on `Doc` objects.
-
-The [`heightAtLine`](https://codemirror.net/doc/manual.html#heightAtLine) method now takes an extra argument to allow finding the height at the top of the line's line widgets.
-
-[ruby mode](https://codemirror.net/mode/ruby): `else` and `elsif` are now immediately indented.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Bind Ctrl-T and Ctrl-D to in- and dedent in insert mode.
-
-## 5.20.2 (2016-10-21)
-
-### Bug fixes
-
-Fix `CodeMirror.version` returning the wrong version number.
-
-## 5.20.0 (2016-10-20)
-
-### 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](https://codemirror.net/doc/manual.html#option_lineSeparator).
-
-[javascript mode](https://codemirror.net/mode/javascript): Improve support for class expressions. Support TypeScript optional class properties, the `abstract` keyword, and return type declarations for arrow functions.
-
-[css mode](https://codemirror.net/mode/css): Fix highlighting of mixed-case keywords.
-
-[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): 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 run build` (but when installing from NPM, it is included).
-
-The [`refresh`](https://codemirror.net/doc/manual.html#event_refresh) event is now documented and stable.
-
-## 5.19.0 (2016-09-20)
-
-### Bugfixes
-
-[erlang mode](https://codemirror.net/mode/erlang): Fix mode crash when trying to read an empty context.
-
-[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix broken behavior when toggling comments inside a comment.
-
-xml-fold addon: Fix a null-dereference bug.
-
-Page up and page down now do something even in single-line documents.
-
-Fix an issue where the cursor position could be off in really long (~8000 character) tokens.
-
-### New features
-
-[javascript mode](https://codemirror.net/mode/javascript): Better indentation when semicolons are missing. Better support for TypeScript classes, optional parameters, and the `type` keyword.
-
-The [`blur`](https://codemirror.net/doc/manual.html#event_blur) and [`focus`](https://codemirror.net/doc/manual.html#event_focus) events now pass the DOM event to their handlers.
-
-## 5.18.2 (2016-08-23)
-
-### Bugfixes
-
-[vue mode](https://codemirror.net/mode/vue): Fix outdated references to renamed Pug mode dependency.
-
-## 5.18.0 (2016-08-22)
-
-### Bugfixes
-
-Make sure [gutter backgrounds](https://codemirror.net/doc/manual.html#addLineClass) stick to the rest of the gutter during horizontal scrolling.
-
-The contenteditable [`inputStyle`](https://codemirror.net/doc/manual.html#option_inputStyle) now properly supports pasting on pre-Edge IE versions.
-
-[javascript mode](https://codemirror.net/mode/javascript): Fix some small parsing bugs and improve TypeScript support.
-
-[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Fix bug where active highlighting was left in editor when the addon was disabled.
-
-[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Only start highlighting things when the editor gains focus.
-
-[javascript-hint addon](https://codemirror.net/doc/manual.html#addon_javascript-hint): Also complete non-enumerable properties.
-
-### New features
-
-The [`addOverlay`](https://codemirror.net/doc/manual.html#addOverlay) method now supports a `priority` option to control the order in which overlays are applied.
-
-MIME types that end in `+json` now default to the JSON mode when the MIME itself is not defined.
-
-### Breaking changes
-
-The mode formerly known as Jade was renamed to [Pug](https://codemirror.net/mode/pug).
-
-The [Python mode](https://codemirror.net/mode/python) now defaults to Python 3 (rather than 2) syntax.
-
-## 5.17.0 (2016-07-19)
-
-### Bugfixes
-
-Fix problem with wrapped trailing whitespace displaying incorrectly.
-
-Prevent IME dialog from overlapping typed content in Chrome.
-
-Improve measuring of characters near a line wrap.
-
-[javascript mode](https://codemirror.net/mode/javascript): Improve support for `async`, allow trailing commas in `import` lists.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Fix backspace in replace mode.
-
-[sublime bindings](https://codemirror.net/demo/sublime.html): Fix some key bindings on OS X to match Sublime Text.
-
-### New features
-
-[markdown mode](https://codemirror.net/mode/markdown): Add more classes to image links in highlight-formatting mode.
-
-## 5.16.0 (2016-06-20)
-
-### Bugfixes
-
-Fix glitches when dragging content caused by the drop indicator receiving mouse events.
-
-Make Control-drag work on Firefox.
-
-Make clicking or selection-dragging at the end of a wrapped line select the right position.
-
-[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Prevent widget scrollbar from hiding part of the hint text.
-
-[rulers addon](https://codemirror.net/doc/manual.html#addon_rulers): Prevent rulers from forcing a horizontal editor scrollbar.
-
-### New features
-
-[search addon](https://codemirror.net/doc/manual.html#addon_search): Automatically bind search-related keys in persistent dialog.
-
-[sublime keymap](https://codemirror.net/demo/sublime.html): Add a multi-cursor aware smart backspace binding.
-
-## 5.15.2 (2016-05-20)
-
-### Bugfixes
-
-Fix a critical document corruption bug that occurs when a document is gradually grown.
-
-## 5.15.0 (2016-05-20)
-
-### Bugfixes
-
-Fix bug that caused the selection to reset when focusing the editor in contentEditable input mode.
-
-Fix issue where not all ASCII control characters were being replaced by placeholders.
-
-Remove the assumption that all modes have a `startState` method from several wrapping modes.
-
-Fix issue where the editor would complain about overlapping collapsed ranges when there weren't any.
-
-Optimize document tree building when loading or pasting huge chunks of content.
-
-[markdown mode](https://codemirror.net/mode/markdown/): Fix several issues in matching link targets.
-
-[clike mode](https://codemirror.net/mode/clike/): Improve indentation of C++ template declarations.
-
-### New features
-
-Explicitly bind Ctrl-O on OS X to make that binding (“open line”) act as expected.
-
-Pasting [linewise-copied](https://codemirror.net/doc/manual.html#option_lineWiseCopyCut) content when there is no selection now inserts the lines above the current line.
-
-[javascript mode](https://codemirror.net/mode/javascript/): Support `async`/`await` and improve support for TypeScript type syntax.
-
-## 5.14.2 (2016-04-20)
-
-### Bugfixes
-
-Push a new package to NPM due to an [NPM bug](https://github.com/npm/npm/issues/5082) omitting the LICENSE file in 5.14.0.
-
-Set `dataTransfer.effectAllowed` in `dragstart` handler to help browsers use the right drag icon.
-
-Add the [mbox mode](https://codemirror.net/mode/mbox/index.html) to `mode/meta.js`.
-
-## 5.14.0 (2016-04-20)
-
-### Bugfixes
-
-[`posFromIndex`](https://codemirror.net/doc/manual.html#posFromIndex) and [`indexFromPos`](https://codemirror.net/doc/manual.html#indexFromPos) now take [`lineSeparator`](https://codemirror.net/doc/manual.html#option_lineSeparator) into account.
-
-[vim bindings](https://codemirror.net/demo/vim.html): Only call `.save()` when it is actually available.
-
-[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Be careful not to mangle multi-line strings.
-
-[Python mode](https://codemirror.net/mode/python/index.html): Improve distinguishing of decorators from `@` operators.
-
-[`findMarks`](https://codemirror.net/doc/manual.html#findMarks): No longer return marks that touch but don't overlap given range.
-
-### New features
-
-[vim bindings](https://codemirror.net/demo/vim.html): Add yank command.
-
-[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Add `trim` option to disable ignoring of whitespace.
-
-[PowerShell mode](https://codemirror.net/mode/powershell/index.html): Added.
-
-[Yacas mode](https://codemirror.net/mode/yacas/index.html): Added.
-
-[Web IDL mode](https://codemirror.net/mode/webidl/index.html): Added.
-
-[SAS mode](https://codemirror.net/mode/sas/index.html): Added.
-
-[mbox mode](https://codemirror.net/mode/mbox/index.html): Added.
-
-## 5.13.2 (2016-03-23)
-
-### Bugfixes
-
-Solves a problem where the gutter would sometimes not extend all the way to the end of the document.
-
-## 5.13.0 (2016-03-21)
-
-### New features
-
-New DOM event forwarded: [`"dragleave"`](https://codemirror.net/doc/manual.html#event_dom).
-
-[protobuf mode](https://codemirror.net/mode/protobuf/index.html): Newly added.
-
-### Bugfixes
-
-Fix problem where [`findMarks`](https://codemirror.net/doc/manual.html#findMarks) sometimes failed to find multi-line marks.
-
-Fix crash that showed up when atomic ranges and bidi text were combined.
-
-[show-hint addon](https://codemirror.net/demo/complete.html): Completion widgets no longer close when the line indented or dedented.
-
-[merge addon](https://codemirror.net/demo/merge.html): Fix bug when merging chunks at the end of the file.
-
-[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): No longer gets confused by [`swapDoc`](https://codemirror.net/doc/manual.html#swapDoc).
-
-[simplescrollbars addon](https://codemirror.net/doc/manual.html#addon_simplescrollbars): Fix invalid state when deleting at end of document.
-
-[clike mode](https://codemirror.net/mode/clike/index.html): No longer gets confused when a comment starts after an operator.
-
-[markdown mode](https://codemirror.net/mode/markdown/index.html): Now supports CommonMark-style flexible list indentation.
-
-[dylan mode](https://codemirror.net/mode/dylan/index.html): Several improvements and fixes.
-
-## 5.12.0 (2016-02-19)
-
-### New features
-
-[Vim bindings](https://codemirror.net/demo/vim.html): Ctrl-Q is now an alias for Ctrl-V.
-
-[Vim bindings](https://codemirror.net/demo/vim.html): The Vim API now exposes an `unmap` method to unmap bindings.
-
-[active-line addon](https://codemirror.net/demo/activeline.html): This addon can now style the active line's gutter.
-
-[FCL mode](https://codemirror.net/mode/fcl/): Newly added.
-
-[SQL mode](https://codemirror.net/mode/sql/): Now has a Postgresql dialect.
-
-### Bugfixes
-
-Fix [issue](https://github.com/codemirror/CodeMirror/issues/3781) where trying to scroll to a horizontal position outside of the document's width could cause the gutter to be positioned incorrectly.
-
-Use absolute, rather than fixed positioning in the context-menu intercept hack, to work around a [problem](https://github.com/codemirror/CodeMirror/issues/3238) when the editor is inside a transformed parent container.
-
-Solve a [problem](https://github.com/codemirror/CodeMirror/issues/3821) where the horizontal scrollbar could hide text in Firefox.
-
-Fix a [bug](https://github.com/codemirror/CodeMirror/issues/3834) that caused phantom scroll space under the text in some situations.
-
-[Sublime Text bindings](https://codemirror.net/demo/sublime.html): Bind delete-line to Shift-Ctrl-K on OS X.
-
-[Markdown mode](https://codemirror.net/mode/markdown/): Fix [issue](https://github.com/codemirror/CodeMirror/issues/3787) where the mode would keep state related to fenced code blocks in an unsafe way, leading to occasional corrupted parses.
-
-[Markdown mode](https://codemirror.net/mode/markdown/): Ignore backslashes in code fragments.
-
-[Markdown mode](https://codemirror.net/mode/markdown/): Use whichever mode is registered as `text/html` to parse HTML.
-
-[Clike mode](https://codemirror.net/mode/clike/): Improve indentation of Scala `=>` functions.
-
-[Python mode](https://codemirror.net/mode/python/): Improve indentation of bracketed code.
-
-[HTMLMixed mode](https://codemirror.net/mode/htmlmixed/): Support multi-line opening tags for sub-languages (`
-
-
-
-
-
-
-Active Line Demo
-
-
-
-
- Styling the current cursor line.
-
- Enable nonEmpty
option
-
-
diff --git a/release/libraries/codemirror/demo/anywordhint.html b/release/libraries/codemirror/demo/anywordhint.html
deleted file mode 100644
index 57df9a3..0000000
--- a/release/libraries/codemirror/demo/anywordhint.html
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-CodeMirror: Any Word Completion Demo
-
-
-
-
-
-
-
-
-
-
-
-
-Any Word Completion Demo
-
-(function() {
- "use strict";
-
- var WORD = /[\w$]+/, RANGE = 500;
-
- CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
- var word = options && options.word || WORD;
- var range = options && options.range || RANGE;
- var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
- var end = cur.ch, start = end;
- while (start && word.test(curLine.charAt(start - 1))) --start;
- var curWord = start != end && curLine.slice(start, end);
-
- var list = options && options.list || [], seen = {};
- var re = new RegExp(word.source, "g");
- for (var dir = -1; dir <= 1; dir += 2) {
- var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
- for (; line != endLine; line += dir) {
- var text = editor.getLine(line), m;
- while (m = re.exec(text)) {
- if (line == cur.line && m[0] === curWord) continue;
- if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) {
- seen[m[0]] = true;
- list.push(m[0]);
- }
- }
- }
- }
- return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};
- });
-})();
-
-
-Press ctrl-space to activate autocompletion. The
-completion uses
-the anyword-hint.js
-module, which simply looks at nearby words in the buffer and completes
-to those.
-
-
-
diff --git a/release/libraries/codemirror/demo/bidi.html b/release/libraries/codemirror/demo/bidi.html
deleted file mode 100644
index a7d22d6..0000000
--- a/release/libraries/codemirror/demo/bidi.html
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-CodeMirror: Bi-directional Text Demo
-
-
-
-
-
-
-
-
-
-
-Bi-directional Text Demo
-
-
-
-
- value (string or Doc)
- قيمة البداية المحرر. يمكن أن تكون سلسلة، أو. كائن مستند.
- mode (string or object)
- وضع الاستخدام. عندما لا تعطى، وهذا الافتراضي إلى الطريقة الاولى
- التي تم تحميلها. قد يكون من سلسلة، والتي إما أسماء أو ببساطة هو وضع
- MIME نوع المرتبطة اسطة. بدلا من ذلك، قد يكون من كائن يحتوي على
- خيارات التكوين لواسطة، مع name
الخاصية التي وضع أسماء
- (على سبيل المثال {name: "javascript", json: true}
).
- صفحات التجريبي لكل وضع تحتوي على معلومات حول ما معلمات تكوين وضع
- يدعمها. يمكنك أن تطلب CodeMirror التي تم تعريفها طرق وأنواع MIME
- الكشف على CodeMirror.modes
- و CodeMirror.mimeModes
الكائنات. وضع خرائط الأسماء
- الأولى لمنشئات الخاصة بهم، وخرائط لأنواع MIME 2 المواصفات
- واسطة.
- theme (string)
- موضوع لنمط المحرر مع. يجب عليك التأكد من الملف CSS تحديد
- المقابلة .cm-s-[name]
يتم تحميل أنماط (انظر
- theme
الدليل في التوزيع).
- الافتراضي هو "default"
، والتي تم تضمينها في
- الألوان codemirror.css
. فمن الممكن استخدام فئات متعددة
- في تطبيق السمات مرة واحدة على سبيل المثال "foo bar"
- سيتم تعيين كل من cm-s-foo
و cm-s-bar
- الطبقات إلى المحرر.
-
-
-
- Editor default direction:
- LTR
- RTL
-
-
- HTML document direction:
- LTR
- RTL
-
-
- Use visual order for arrow key movement.
-
-
-
-
-
- Demonstration of bi-directional text support. See
- the related
- blog post for more background.
-
-
diff --git a/release/libraries/codemirror/demo/btree.html b/release/libraries/codemirror/demo/btree.html
deleted file mode 100644
index 3188101..0000000
--- a/release/libraries/codemirror/demo/btree.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-CodeMirror: B-Tree visualization
-
-
-
-
-
-
-
-
-
-B-Tree visualization
-type here, see a summary of the document b-tree below
-
-
-
-
-Add a lot of content
-
-
diff --git a/release/libraries/codemirror/demo/buffers.html b/release/libraries/codemirror/demo/buffers.html
deleted file mode 100644
index b1f4975..0000000
--- a/release/libraries/codemirror/demo/buffers.html
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-CodeMirror: Multiple Buffer & Split View Demo
-
-
-
-
-
-
-
-
-
-
-
-Multiple Buffer & Split View Demo
-
-
-
-
- Select buffer:
- New buffer
-
-
-
- Select buffer:
- New buffer
-
-
-
-
- Demonstration of
- using linked documents
- to provide a split view on a document, and
- using swapDoc
- to use a single editor to display multiple documents.
-
-
diff --git a/release/libraries/codemirror/demo/changemode.html b/release/libraries/codemirror/demo/changemode.html
deleted file mode 100644
index da9b024..0000000
--- a/release/libraries/codemirror/demo/changemode.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-CodeMirror: Mode-Changing Demo
-
-
-
-
-
-
-
-
-
-
-
-Mode-Changing Demo
-
-;; If there is Scheme code in here, the editor will be in Scheme mode.
-;; If you put in JS instead, it'll switch to JS mode.
-
-(define (double x)
- (* x x))
-
-
-On changes to the content of the above editor, a (crude) script
-tries to auto-detect the language used, and switches the editor to
-either JavaScript or Scheme mode based on that.
-
-
-
diff --git a/release/libraries/codemirror/demo/closebrackets.html b/release/libraries/codemirror/demo/closebrackets.html
deleted file mode 100644
index d1415ab..0000000
--- a/release/libraries/codemirror/demo/closebrackets.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-CodeMirror: Closebrackets Demo
-
-
-
-
-
-
-
-
-
-
-
-Closebrackets Demo
-function Grid(width, height) {
- this.width = width;
- this.height = height;
- this.cells = new Array(width * height);
-}
-Grid.prototype.valueAt = function(point) {
- return this.cells[point.y * this.width + point.x];
-};
-Grid.prototype.setValueAt = function(point, value) {
- this.cells[point.y * this.width + point.x] = value;
-};
-Grid.prototype.isInside = function(point) {
- return point.x >= 0 && point.y >= 0 &&
- point.x < this.width && point.y < this.height;
-};
-Grid.prototype.moveValue = function(from, to) {
- this.setValueAt(to, this.valueAt(from));
- this.setValueAt(from, undefined);
-};
-
-
-
diff --git a/release/libraries/codemirror/demo/closetag.html b/release/libraries/codemirror/demo/closetag.html
deleted file mode 100644
index 1f86114..0000000
--- a/release/libraries/codemirror/demo/closetag.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-CodeMirror: Close-Tag Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Close-Tag Demo
-
-
-
- Uses the closetag addon to auto-close tags.
-
diff --git a/release/libraries/codemirror/demo/complete.html b/release/libraries/codemirror/demo/complete.html
deleted file mode 100644
index 3e7bd5f..0000000
--- a/release/libraries/codemirror/demo/complete.html
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-CodeMirror: Autocomplete Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Autocomplete Demo
-
-function getCompletions(token, context) {
- var found = [], start = token.string;
- function maybeAdd(str) {
- if (str.indexOf(start) == 0) found.push(str);
- }
- function gatherCompletions(obj) {
- if (typeof obj == "string") forEach(stringProps, maybeAdd);
- else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
- else if (obj instanceof Function) forEach(funcProps, maybeAdd);
- for (var name in obj) maybeAdd(name);
- }
-
- if (context) {
- // If this is a property, see if it belongs to some object we can
- // find in the current environment.
- var obj = context.pop(), base;
- if (obj.className == "js-variable")
- base = window[obj.string];
- else if (obj.className == "js-string")
- base = "";
- else if (obj.className == "js-atom")
- base = 1;
- while (base != null && context.length)
- base = base[context.pop().string];
- if (base != null) gatherCompletions(base);
- }
- else {
- // If not, just look in the window object and any local scope
- // (reading into JS mode internals to get at the local variables)
- for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
- gatherCompletions(window);
- forEach(keywords, maybeAdd);
- }
- return found;
-}
-
-
-Press ctrl-space to activate autocompletion. Built
-on top of the show-hint
-and javascript-hint
-addons.
-
-
-Here, the completion use an asynchronous hinting function to provide
-synonyms for each words. If your browser support `Promises`, the
-hinting function can also return one.
-
-
-
-
-
diff --git a/release/libraries/codemirror/demo/emacs.html b/release/libraries/codemirror/demo/emacs.html
deleted file mode 100644
index 8f436f8..0000000
--- a/release/libraries/codemirror/demo/emacs.html
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-CodeMirror: Emacs bindings demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Emacs bindings demo
-
-#include "syscalls.h"
-/* getchar: simple buffered version */
-int getchar(void)
-{
- static char buf[BUFSIZ];
- static char *bufp = buf;
- static int n = 0;
- if (n == 0) { /* buffer is empty */
- n = read(0, buf, sizeof buf);
- bufp = buf;
- }
- return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-
-
-The emacs keybindings are enabled by
-including keymap/emacs.js and setting
-the keyMap
option to "emacs"
. Because
-CodeMirror's internal API is quite different from Emacs, they are only
-a loose approximation of actual emacs bindings, though.
-
-Also note that a lot of browsers disallow certain keys from being
-captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the
-result that idiomatic use of Emacs keys will constantly close your tab
-or open a new window.
-
-
-
-
diff --git a/release/libraries/codemirror/demo/folding.html b/release/libraries/codemirror/demo/folding.html
deleted file mode 100644
index 166aa98..0000000
--- a/release/libraries/codemirror/demo/folding.html
+++ /dev/null
@@ -1,184 +0,0 @@
-
-
-
- CodeMirror: Code Folding Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code Folding Demo
-
- JavaScript:
-
- HTML:
-
- JSON with custom widget:
-
-{
- "menu": {
- "id": "file",
- "value": "File",
- "popup": {
- "menuitem": [
- {"value": "New", "onclick": "CreateNewDoc()"},
- {"value": "Open", "onclick": "OpenDoc()"},
- {"value": "Close", "onclick": "CloseDoc()"}
- ]
- }
- }
-}
-
- Python:
-
-def foo():
- do_some_stuff()
- here
- return None
-
-class Bar:
- __init__(self):
- if True:
- print("True")
- else:
- print("False")
-
- this_code_makes_no_sense():
- pass
-
-# A comment
- Markdown:
-
-
-
-
-
diff --git a/release/libraries/codemirror/demo/fullscreen.html b/release/libraries/codemirror/demo/fullscreen.html
deleted file mode 100644
index 06bf03e..0000000
--- a/release/libraries/codemirror/demo/fullscreen.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-CodeMirror: Full Screen Editing
-
-
-
-
-
-
-
-
-
-
-
-
-
-Full Screen Editing
-
-
- indentWithTabs : boolean
- Whether, when indenting, the first N*tabSize
- spaces should be replaced by N tabs. Default is false.
-
- electricChars : boolean
- Configures whether the editor should re-indent the current
- line when a character is typed that might change its proper
- indentation (only works if the mode supports indentation).
- Default is true.
-
- specialChars : RegExp
- A regular expression used to determine which characters
- should be replaced by a
- special placeholder .
- Mostly useful for non-printing special characters. The default
- is /[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/
.
- specialCharPlaceholder : function(char) → Element
- A function that, given a special character identified by
- the specialChars
- option, produces a DOM node that is used to represent the
- character. By default, a red dot (• )
- is shown, with a title tooltip to indicate the character code.
-
- rtlMoveVisually : boolean
- Determines whether horizontal cursor movement through
- right-to-left (Arabic, Hebrew) text is visual (pressing the left
- arrow moves the cursor left) or logical (pressing the left arrow
- moves to the next lower index in the string, which is visually
- right in right-to-left text). The default is false
- on Windows, and true
on other platforms.
-
-
-
-
- Demonstration of
- the fullscreen
- addon. Press F11 when cursor is in the editor to
- toggle full screen editing. Esc can also be used
- to exit full screen editing.
-
diff --git a/release/libraries/codemirror/demo/hardwrap.html b/release/libraries/codemirror/demo/hardwrap.html
deleted file mode 100644
index 999cf01..0000000
--- a/release/libraries/codemirror/demo/hardwrap.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-CodeMirror: Hard-wrapping Demo
-
-
-
-
-
-
-
-
-
-
-
-Hard-wrapping Demo
-Lorem ipsum dolor sit amet, vim augue dictas constituto ex,
-sit falli simul viderer te. Graeco scaevola maluisset sit
-ut, in idque viris praesent sea. Ea sea eirmod indoctum
-repudiare. Vel noluisse suscipit pericula ut. In ius nulla
-alienum molestie. Mei essent discere democritum id.
-
-Equidem ponderum expetendis ius in, mea an erroribus
-constituto, congue timeam perfecto ad est. Ius ut primis
-timeam, per in ullum mediocrem. An case vero labitur pri,
-vel dicit laoreet et. An qui prompta conclusionemque, eam
-timeam sapientem in, cum dictas epicurei eu.
-
-Usu cu vide dictas deseruisse, eum choro graece adipiscing
-ut. Cibo qualisque ius ad, et dicat scripta mea, eam nihil
-mentitum aliquando cu. Debet aperiam splendide at quo, ad
-paulo nostro commodo duo. Sea adhuc utinam conclusionemque
-id, quas doming malorum nec ad. Tollit eruditi vivendum ad
-ius, eos soleat ignota ad.
-
-
-Demonstration of
-the hardwrap addon.
-The above editor has its change event hooked up to
-the wrapParagraphsInRange
method, so that the paragraphs
-are reflown as you are typing.
-
-
-
-
diff --git a/release/libraries/codemirror/demo/html5complete.html b/release/libraries/codemirror/demo/html5complete.html
deleted file mode 100644
index 6b908a4..0000000
--- a/release/libraries/codemirror/demo/html5complete.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
- CodeMirror: HTML completion demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HTML completion demo
-
- Shows the XML completer
- parameterized with information about the tags in HTML.
- Press ctrl-space to activate completion.
-
-
-
-
-
-
diff --git a/release/libraries/codemirror/demo/indentwrap.html b/release/libraries/codemirror/demo/indentwrap.html
deleted file mode 100644
index d61f679..0000000
--- a/release/libraries/codemirror/demo/indentwrap.html
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-CodeMirror: Indented wrapped line demo
-
-
-
-
-
-
-
-
-
-
-Indented wrapped line demo
-
-
-
- Overview
-
- CodeMirror is a code-editor component that can be embedded in Web pages. The core library provides only the editor component, no accompanying buttons, auto-completion, or other IDE functionality. It does provide a rich API on top of which such functionality can be straightforwardly implemented. See the add-ons included in the distribution, and the CodeMirror UI project, for reusable implementations of extra features.
-
- CodeMirror works with language-specific modes. Modes are JavaScript programs that help color (and optionally indent) text written in a given language. The distribution comes with a number of modes (see the mode/
directory), and it isn't hard to write new ones for other languages.
-
-
-
- This page uses a hack on top of the "renderLine"
- event to make wrapped text line up with the base indentation of
- the line.
-
-
-
-
diff --git a/release/libraries/codemirror/demo/lint.html b/release/libraries/codemirror/demo/lint.html
deleted file mode 100644
index 1184232..0000000
--- a/release/libraries/codemirror/demo/lint.html
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-CodeMirror: Linter Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Linter Demo
-
-
- var widgets = []
-function updateHints() {
- editor.operation(function(){
- for (var i = 0; i < widgets.length.; ++i)
- editor.removeLineWidget(widgets[i]);
- widgets.length = 0;
-
- JSHINT(editor.getValue());
- for (var i = 0; i < JSHINT.errors.length; ++i) {
- var err = JSHINT.errors[i];
- if (!err) continue;
- var msg = document.createElement("div");
- var icon = msg.appendChild(document.createElement("span"));
- icon.innerHTML = "!!";
- icon.className = "lint-error-icon";
- msg.appendChild(document.createTextNode(err.reason));
- msg.className = "lint-error";
- widgets.push(editor.addLineWidget(err.line - 1, msg, {coverGutter: false, noHScroll: true}));
- }
- });
- var info = editor.getScrollInfo();
- var after = editor.charCoords({line: editor.getCursor().line + 1, ch: 0}, "local").top;
- if (info.top + info.clientHeight < after)
- editor.scrollTo(null, after - info.clientHeight + 3);
-}
-
-
- [
- {
- _id: "post 1",
- "author": "Bob",
- "content": "...",
- "page_views": 5
- },
- {
- "_id": "post 2",
- "author": "Bob",
- "content": "...",
- "page_views": 9
- },
- {
- "_id": "post 3",
- "author": "Bob",
- "content": "...",
- "page_views": 8
- }
-]
-
-
- @charset "UTF-8";
-
-@import url("booya.css") print, screen;
-@import "whatup.css" screen;
-@import "wicked.css";
-
-/*Error*/
-@charset "UTF-8";
-
-
-@namespace "http://www.w3.org/1999/xhtml";
-@namespace svg "http://www.w3.org/2000/svg";
-
-/*Warning: empty ruleset */
-.foo {
-}
-
-h1 {
- font-weight: bold;
-}
-
-/*Warning: qualified heading */
-.foo h1 {
- font-weight: bold;
-}
-
-/*Warning: adjoining classes */
-.foo.bar {
- zoom: 1;
-}
-
-li.inline {
- width: 100%; /*Warning: 100% can be problematic*/
-}
-
-li.last {
- display: inline;
- padding-left: 3px !important;
- padding-right: 3px;
- border-right: 0px;
-}
-
-@media print {
- li.inline {
- color: black;
- }
-}
-
-@page {
- margin: 10%;
- counter-increment: page;
-
- @top-center {
- font-family: sans-serif;
- font-weight: bold;
- font-size: 2em;
- content: counter(page);
- }
-}
-
-
-
-
diff --git a/release/libraries/codemirror/demo/loadmode.html b/release/libraries/codemirror/demo/loadmode.html
deleted file mode 100644
index 263d679..0000000
--- a/release/libraries/codemirror/demo/loadmode.html
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-CodeMirror: Lazy Mode Loading Demo
-
-
-
-
-
-
-
-
-
-
-
-Lazy Mode Loading Demo
-Current mode: text/plain
-This is the editor.
-// It starts out in plain text mode,
-# use the control below to load and apply a mode
- "you'll see the highlighting of" this text /*change*/.
-
-Filename, mime, or mode name: change mode
-
-
-
diff --git a/release/libraries/codemirror/demo/marker.html b/release/libraries/codemirror/demo/marker.html
deleted file mode 100644
index 6744ee3..0000000
--- a/release/libraries/codemirror/demo/marker.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-CodeMirror: Breakpoint Demo
-
-
-
-
-
-
-
-
-
-
-Breakpoint Demo
-
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
- lineNumbers: true,
- gutters: ["CodeMirror-linenumbers", "breakpoints"]
-});
-editor.on("gutterClick", function(cm, n) {
- var info = cm.lineInfo(n);
- cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
-});
-
-function makeMarker() {
- var marker = document.createElement("div");
- marker.style.color = "#822";
- marker.innerHTML = "●";
- return marker;
-}
-
-
-Click the line-number gutter to add or remove 'breakpoints'.
-
-
-
-
diff --git a/release/libraries/codemirror/demo/markselection.html b/release/libraries/codemirror/demo/markselection.html
deleted file mode 100644
index 10734b4..0000000
--- a/release/libraries/codemirror/demo/markselection.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-CodeMirror: Selection Marking Demo
-
-
-
-
-
-
-
-
-
-
-
-Selection Marking Demo
-
-Select something from here. You'll see that the selection's foreground
-color changes to white! Since, by default, CodeMirror only puts an
-independent "marker" layer behind the text, you'll need something like
-this to change its colour.
-
-Also notice that turning this addon on (with the default style) allows
-you to safely give text a background color without screwing up the
-visibility of the selection.
-
-
-
- Simple addon to easily mark (and style) selected text. Docs .
-
-
diff --git a/release/libraries/codemirror/demo/matchhighlighter.html b/release/libraries/codemirror/demo/matchhighlighter.html
deleted file mode 100644
index 8e0ff25..0000000
--- a/release/libraries/codemirror/demo/matchhighlighter.html
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-CodeMirror: Match Highlighter Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-Match Highlighter Demo
-Select this text: hardtospot
- And everywhere else in your code where hardtospot appears will
-automatically illuminate. Give it a try! No more hard to spot
-variables - stay in context of your code all the time.
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut pharetra
-interdum dui eu pulvinar. Mauris maximus ligula venenatis tempus
-interdum. Cras hendrerit, ipsum sed ultrices pharetra, ligula diam
-porttitor lacus, ac tempor eros est a massa. Nam orci elit, vulputate
-in tristique quis, consectetur vitae metus. Pellentesque et enim
-elementum, lobortis augue in, lacinia sapien. Morbi eu nunc semper,
-sagittis felis a, pellentesque mauris. Lorem ipsum dolor sit amet,
-consectetur adipiscing elit. Aenean quis diam turpis.
-
-Fusce lobortis nisl quis aliquet euismod. Aenean vitae nulla non ipsum
-efficitur scelerisque. Curabitur auctor, lorem non rhoncus porttitor,
-augue ligula lacinia dolor, et vehicula magna lorem imperdiet velit.
-Fusce risus sem, hardtospot commodo eleifend hendrerit vitae, mollis
-quis risus. Cras tincidunt, justo vitae hendrerit venenatis, urna
-dolor placerat tortor, eu lobortis lectus dolor in ligula. Nullam non
-erat non nisl vulputate ultrices sit amet vestibulum dolor. Quisque in
-tortor porta, pellentesque odio nec, malesuada nibh.
-
-In a dui feugiat, ullamcorper urna in, accumsan magna. Donec egestas
-sem nec eros rhoncus, vel gravida purus ornare. Nulla orci mauris,
-porta nec pharetra sed, ornare et lorem. Donec luctus turpis nunc,
-eget dictum felis mollis et. Sed sodales hardtospot nunc vitae leo
-rhoncus imperdiet. Donec elementum malesuada velit quis placerat.
-Proin accumsan lorem id nisi volutpat ullamcorper. Vivamus laoreet
-dolor ac sem malesuada, ac scelerisque ex efficitur. Aliquam tempus
-libero velit, vel tristique augue vulputate nec.
-
-Mauris ultrices leo felis, sit amet congue augue aliquam condimentum.
-Vivamus purus leo, mattis vitae dignissim vel, ultricies ac ex. Mauris
-eu dolor eu purus ultricies ultrices. Sed euismod feugiat ex et
-mattis. Morbi cursus laoreet pharetra. Donec eu dolor sodales,
-ultricies nisi et, malesuada urna. Praesent sit amet fringilla felis.
-Nam rhoncus, est blandit auctor auctor, lorem ipsum laoreet ipsum,
-quis sodales libero odio in lorem. Phasellus odio dolor, elementum
-sagittis nibh non, fermentum semper libero. Mauris hendrerit
-hardtospot lectus sit amet commodo eleifend. Morbi pulvinar eget nisl
-at eleifend. Fusce eget porta erat, vitae lobortis libero.
-
-Phasellus sit amet massa in massa pharetra malesuada. Vestibulum at
-quam vel libero aliquam volutpat at ut dui. Praesent scelerisque vel
-mauris sit amet vehicula. Phasellus at mi nec ligula cursus interdum
-sit amet non quam. Aliquam tempus sollicitudin euismod. Nulla euismod
-mollis enim tincidunt placerat. Proin ac scelerisque enim, quis
-sollicitudin metus. Pellentesque congue nec sapien ut rhoncus. Sed
-eget ornare diam, ut consectetur ante. Aenean eleifend mauris quis
-ornare accumsan. In hac habitasse hardtospot platea dictumst.
-
-
-
-
-
- Search and highlight occurrences of the selected text.
-
-
diff --git a/release/libraries/codemirror/demo/matchtags.html b/release/libraries/codemirror/demo/matchtags.html
deleted file mode 100644
index a5ff6b0..0000000
--- a/release/libraries/codemirror/demo/matchtags.html
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-CodeMirror: Tag Matcher Demo
-
-
-
-
-
-
-
-
-
-
-
-
-Tag Matcher Demo
-
-
-
-
-
-
- Put the cursor on or inside a pair of tags to highlight them.
- Press Ctrl-J to jump to the tag that matches the one under the
- cursor.
-
diff --git a/release/libraries/codemirror/demo/merge.html b/release/libraries/codemirror/demo/merge.html
deleted file mode 100644
index 6eff813..0000000
--- a/release/libraries/codemirror/demo/merge.html
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-CodeMirror: merge view demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-merge view demo
-
-
-
-
-The merge
-addon provides an interface for displaying and merging diffs,
-either two-way
-or three-way .
-The left (or center) pane is editable, and the differences with the
-other pane(s) are optionally shown live as you edit
-it. In the two-way configuration, there are also options to pad changed
-sections to align them, and to collapse unchanged
-stretches of text.
-
-This addon depends on
-the google-diff-match-patch
-library to compute the diffs.
-
-
-
diff --git a/release/libraries/codemirror/demo/multiplex.html b/release/libraries/codemirror/demo/multiplex.html
deleted file mode 100644
index 1336620..0000000
--- a/release/libraries/codemirror/demo/multiplex.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-CodeMirror: Multiplexing Parser Demo
-
-
-
-
-
-
-
-
-
-
-
-Multiplexing Parser Demo
-
-
-
- << this is not >
- <<
- multiline
- not html
- at all : &
- >>
- this is html again
-
-
-
-
-
-
- Demonstration of a multiplexing mode, which, at certain
- boundary strings, switches to one or more inner modes. The out
- (HTML) mode does not get fed the content of the <<
- >>
blocks. See
- the manual and
- the source for more
- information.
-
-
- Parsing/Highlighting Tests:
- normal ,
- verbose .
-
-
-
diff --git a/release/libraries/codemirror/demo/mustache.html b/release/libraries/codemirror/demo/mustache.html
deleted file mode 100644
index f37f01b..0000000
--- a/release/libraries/codemirror/demo/mustache.html
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-CodeMirror: Overlay Parser Demo
-
-
-
-
-
-
-
-
-
-
-
-Overlay Parser Demo
-
-
-
- {{title}}
- These are links to {{things}}:
-
-
-
-
-
-
-
- Demonstration of a mode that parses HTML, highlighting
- the Mustache templating
- directives inside of it by using the code
- in overlay.js
. View
- source to see the 15 lines of code needed to accomplish this.
-
-
diff --git a/release/libraries/codemirror/demo/panel.html b/release/libraries/codemirror/demo/panel.html
deleted file mode 100644
index d4f813d..0000000
--- a/release/libraries/codemirror/demo/panel.html
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-CodeMirror: Panel Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Panel Demo
-
-
-
-
-
-
- The panel
- addon allows you to display panels above or below an editor.
-
- Click the links below to add panels at the given position:
-
-
-
-
-
diff --git a/release/libraries/codemirror/demo/placeholder.html b/release/libraries/codemirror/demo/placeholder.html
deleted file mode 100644
index b3bb5fa..0000000
--- a/release/libraries/codemirror/demo/placeholder.html
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-CodeMirror: Placeholder demo
-
-
-
-
-
-
-
-
-
-
-Placeholder demo
-
-
- The placeholder
- plug-in adds an option placeholder
that can be set to
- make text appear in the editor when it is empty and not focused.
- If the source textarea has a placeholder
attribute,
- it will automatically be inherited.
-
-
-
-
diff --git a/release/libraries/codemirror/demo/preview.html b/release/libraries/codemirror/demo/preview.html
deleted file mode 100644
index 660c792..0000000
--- a/release/libraries/codemirror/demo/preview.html
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-CodeMirror: HTML5 preview
-
-
-
-
-
-
-
-
-
-
-
-
-
-HTML5 preview
-
-
-
-
-
-
- HTML5 canvas demo
-
-
-
- Canvas pane goes here:
-
-
-
-
-
-
-
diff --git a/release/libraries/codemirror/demo/requirejs.html b/release/libraries/codemirror/demo/requirejs.html
deleted file mode 100644
index 0503c92..0000000
--- a/release/libraries/codemirror/demo/requirejs.html
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
- CodeMirror: HTML completion demo
-
-
-
-
-
-
-
-
-
-
-
-
-
- RequireJS module loading demo
-
- This demo does the same thing as
- the HTML5 completion demo , but
- loads its dependencies
- with Require.js , rather than
- explicitly. Press ctrl-space to activate
- completion.
-
-
-
- Dynamically load Markdown mode
-
-
-
-
diff --git a/release/libraries/codemirror/demo/resize.html b/release/libraries/codemirror/demo/resize.html
deleted file mode 100644
index 850f560..0000000
--- a/release/libraries/codemirror/demo/resize.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-CodeMirror: Autoresize Demo
-
-
-
-
-
-
-
-
-
-
-Autoresize Demo
-
-.CodeMirror {
- border: 1px solid #eee;
- height: auto;
-}
-
-
-By setting an editor's height
style
-to auto
and giving
-the viewportMargin
-a value of Infinity
, CodeMirror can be made to
-automatically resize to fit its content.
-
-
-
-
diff --git a/release/libraries/codemirror/demo/rulers.html b/release/libraries/codemirror/demo/rulers.html
deleted file mode 100644
index ef12987..0000000
--- a/release/libraries/codemirror/demo/rulers.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-CodeMirror: Ruler Demo
-
-
-
-
-
-
-
-
-
-
-Ruler Demo
-
-
-
-Demonstration of
-the rulers addon, which
-displays vertical lines at given column offsets.
-
-
diff --git a/release/libraries/codemirror/demo/runmode-standalone.html b/release/libraries/codemirror/demo/runmode-standalone.html
deleted file mode 100644
index f3503b9..0000000
--- a/release/libraries/codemirror/demo/runmode-standalone.html
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-CodeMirror: Mode Runner Demo
-
-
-
-
-
-
-
-
-
-Mode Runner Demo
-
-
-
-
- Enter your xml here and press the button below to display
- it as highlighted by the CodeMirror XML mode
-
-
- Highlight!
-
-
-
-
- Running a CodeMirror mode outside of the editor.
- The CodeMirror.runMode
function, defined
- in addon/runmode/runmode.js
takes the following arguments:
-
-
- text (string)
- The document to run through the highlighter.
- mode (mode spec )
- The mode to use (must be loaded as normal).
- output (function or DOM node)
- If this is a function, it will be called for each token with
- two arguments, the token's text and the token's style class (may
- be null
for unstyled tokens). If it is a DOM node,
- the tokens will be converted to span
elements as in
- an editor, and inserted into the node
- (through innerHTML
).
-
-
-
diff --git a/release/libraries/codemirror/demo/runmode.html b/release/libraries/codemirror/demo/runmode.html
deleted file mode 100644
index 0284c40..0000000
--- a/release/libraries/codemirror/demo/runmode.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-CodeMirror: Mode Runner Demo
-
-
-
-
-
-
-
-
-
-
-Mode Runner Demo
-
-
-
-
- Enter your xml here and press the button below to display
- it as highlighted by the CodeMirror XML mode
-
-
- Highlight!
-
-
-
-
- Running a CodeMirror mode outside of the editor.
- The CodeMirror.runMode
function, defined
- in addon/runmode/runmode.js
takes the following arguments:
-
-
- text (string)
- The document to run through the highlighter.
- mode (mode spec )
- The mode to use (must be loaded as normal).
- output (function or DOM node)
- If this is a function, it will be called for each token with
- two arguments, the token's text and the token's style class (may
- be null
for unstyled tokens). If it is a DOM node,
- the tokens will be converted to span
elements as in
- an editor, and inserted into the node
- (through innerHTML
).
-
-
-
diff --git a/release/libraries/codemirror/demo/search.html b/release/libraries/codemirror/demo/search.html
deleted file mode 100644
index 3abb0c7..0000000
--- a/release/libraries/codemirror/demo/search.html
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-CodeMirror: Search/Replace Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Search/Replace Demo
-
-
- indentWithTabs : boolean
- Whether, when indenting, the first N*tabSize
- spaces should be replaced by N tabs. Default is false.
-
- electricChars : boolean
- Configures whether the editor should re-indent the current
- line when a character is typed that might change its proper
- indentation (only works if the mode supports indentation).
- Default is true.
-
- specialChars : RegExp
- A regular expression used to determine which characters
- should be replaced by a
- special placeholder .
- Mostly useful for non-printing special characters. The default
- is /[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/
.
- specialCharPlaceholder : function(char) → Element
- A function that, given a special character identified by
- the specialChars
- option, produces a DOM node that is used to represent the
- character. By default, a red dot (• )
- is shown, with a title tooltip to indicate the character code.
-
- rtlMoveVisually : boolean
- Determines whether horizontal cursor movement through
- right-to-left (Arabic, Hebrew) text is visual (pressing the left
- arrow moves the cursor left) or logical (pressing the left arrow
- moves to the next lower index in the string, which is visually
- right in right-to-left text). The default is false
- on Windows, and true
on other platforms.
-
-
-
-
-
- Demonstration of primitive search/replace functionality. The
- keybindings (which can be configured with custom keymaps) are:
-
- Ctrl-F / Cmd-F Start searching
- Ctrl-G / Cmd-G Find next
- Shift-Ctrl-G / Shift-Cmd-G Find previous
- Shift-Ctrl-F / Cmd-Option-F Replace
- Shift-Ctrl-R / Shift-Cmd-Option-F Replace all
- Alt-F Persistent search (dialog doesn't autoclose,
- enter to find next, Shift-Enter to find previous)
- Alt-G Jump to line
-
- Searching is enabled by
- including addon/search/search.js
- and addon/search/searchcursor.js .
- Jump to line - including addon/search/jump-to-line.js .
- For good-looking input dialogs, you also want to include
- addon/dialog/dialog.js
- and addon/dialog/dialog.css .
-
diff --git a/release/libraries/codemirror/demo/simplemode.html b/release/libraries/codemirror/demo/simplemode.html
deleted file mode 100644
index b03335f..0000000
--- a/release/libraries/codemirror/demo/simplemode.html
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-CodeMirror: Simple Mode Demo
-
-
-
-
-
-
-
-
-
-
-
-
-Simple Mode Demo
-
-The mode/simple
-addon allows CodeMirror modes to be specified using a relatively simple
-declarative format. This format is not as powerful as writing code
-directly against the mode
-interface , but is a lot easier to get started with, and
-sufficiently expressive for many simple language modes.
-
-This interface is still in flux. It is unlikely to be scrapped or
-overhauled completely, so do start writing code against it, but
-details might change as it stabilizes, and you might have to tweak
-your code when upgrading.
-
-Simple modes (loosely based on
-the Common
-JavaScript Syntax Highlighting Specification , which never took
-off), are state machines, where each state has a number of rules that
-match tokens. A rule describes a type of token that may occur in the
-current state, and possibly a transition to another state caused by
-that token.
-
-The CodeMirror.defineSimpleMode(name, states)
method
-takes a mode name and an object that describes the mode's states. The
-editor below shows an example of such a mode (and is itself
-highlighted by the mode shown in it).
-
-
-
-Each state is an array of rules. A rule may have the following properties:
-
-
- regex : string | RegExp
- The regular expression that matches the token. May be a string
- or a regex object. When a regex, the ignoreCase
flag
- will be taken into account when matching the token. This regex
- has to capture groups when the token
property is
- an array. If it captures groups, it must capture all of the string
- (since JS provides no way to find out where a group matched).
- Currently negative lookbehind assertion for regex is not supported, regardless of browser support.
- token
: string | array<string> | null
- An optional token style. Multiple styles can be specified by
- separating them with dots or spaces. When this property holds an array of token styles,
- the regex
for this rule must capture a group for each array item.
-
- sol
: boolean
- When true, this token will only match at the start of the line.
- (The ^
regexp marker doesn't work as you'd expect in
- this context because of limitations in JavaScript's RegExp
- API.)
- next : string
- When a next
property is present, the mode will
- transfer to the state named by the property when the token is
- encountered.
- push : string
- Like next
, but instead replacing the current state
- by the new state, the current state is kept on a stack, and can be
- returned to with the pop
directive.
- pop : bool
- When true, and there is another state on the state stack, will
- cause the mode to pop that state off the stack and transition to
- it.
- mode : {spec, end, persistent}
- Can be used to embed another mode inside a mode. When present,
- must hold an object with a spec
property that describes
- the embedded mode, and an optional end
end property
- that specifies the regexp that will end the extent of the mode. When
- a persistent
property is set (and true), the nested
- mode's state will be preserved between occurrences of the mode.
- indent : bool
- When true, this token changes the indentation to be one unit
- more than the current line's indentation.
- dedent : bool
- When true, this token will pop one scope off the indentation
- stack.
- dedentIfLineStart : bool
- If a token has its dedent
property set, it will, by
- default, cause lines where it appears at the start to be dedented.
- Set this property to false to prevent that behavior.
-
-
-The meta
property of the states object is special, and
-will not be interpreted as a state. Instead, properties set on it will
-be set on the mode, which is useful for properties
-like lineComment
,
-which sets the comment style for a mode. The simple mode addon also
-recognizes a few such properties:
-
-
- dontIndentStates : array<string>
- An array of states in which the mode's auto-indentation should
- not take effect. Usually used for multi-line comment and string
- states.
-
-
-
-
-
-
-
diff --git a/release/libraries/codemirror/demo/simplescrollbars.html b/release/libraries/codemirror/demo/simplescrollbars.html
deleted file mode 100644
index 1604297..0000000
--- a/release/libraries/codemirror/demo/simplescrollbars.html
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-CodeMirror: Simple Scrollbar Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-Simple Scrollbar Demo
-# Custom Scrollbars
-
-This is a piece of text that creates scrollbars
-
-Lorem ipsum dolor sit amet, turpis nec facilisis neque vestibulum adipiscing, magna nunc est luctus orci a,
-aliquam duis ad volutpat nostra. Vestibulum ultricies suspendisse commodo volutpat pede sed. Bibendum odio
-dignissim, ad vitae mollis ac sed nibh quis, suspendisse diam, risus quas blandit phasellus luctus nec,
-integer nunc vitae posuere scelerisque. Lobortis quam porta conubia nulla. Et nisl ac, imperdiet vitae ac.
-Parturient sit. Et vestibulum euismod, rutrum nunc libero mauris purus convallis. Cum id adipiscing et eget
-pretium rutrum, ultrices sapien magnis fringilla sit lorem, eu vitae scelerisque ipsum aliquet, magna sed
-fusce vel.
-
-Lectus ultricies libero dolor convallis, sed etiam vel hendrerit egestas viverra, at urna mauris, eget
-vulputate dolor voluptatem, nulla eget sollicitudin. Sed tincidunt, elit sociis. Mattis mi tortor dui id
-sodales mi, maecenas nam fringilla risus turpis mauris praesent, imperdiet maecenas ultrices nonummy tellus
-quis est. Scelerisque nec pharetra quis varius fringilla. Varius vestibulum non dictum pharetra, tincidunt in
-vestibulum iaculis molestie, id condimentum blandit elit urna magna pulvinar, quam suspendisse pellentesque
-donec. Vel amet ad ac. Nec aut viverra, morbi mi neque massa, turpis enim proin. Tellus eu, fermentum velit
-est convallis aliquam velit, rutrum in diam lacus, praesent tempor pellentesque dictum semper augue. Felis
-explicabo massa amet lectus phasellus dolor. Ut lorem quis arcu neque felis ultricies, senectus vitae
-curabitur sed pellentesque et, id sed risus in sed ac accumsan, blandit arcu quam duis nunc.
-
-Sed leo sollicitudin odio vitae, purus sit egestas, justo eros inceptos auctor fermentum lectus. Ligula luctus
-turpis, quod massa vitae elementum orci, nullam fringilla elit tortor. Justo ante tempor amet quam posuere
-volutpat. Facilisis pede erat ut hac ultrices ipsum, wisi duis sit metus. Dolor vitae est sed sed vitae. Sed
-eu ligula, morbi vestibulum nunc nibh velit ut taciti, ligula elit semper sagittis in, auctor arcu vel eget.
-Mauris at vitae nec suspendisse et, aenean proin blandit suscipit. Morbi quam, dolor ultricies. Viverra
-tempus. Suspendisse sit dapibus, ac fuga aenean, magna nisl nonummy augue posuere, dictum ut fuga velit
-parturient augue interdum, mattis sit tellus.
-
-Vehicula commodo tempus curabitur eros, lacinia erat vulputate lorem vel fermentum donec, lectus sed conubia
-id pellentesque. Vel senectus donec pede aliquet dolor sit, nec vivamus justo placerat interdum maecenas,
-sodales euismod. Quis netus sapien amet, vestibulum quam nec amet lacinia, quis aliquet, tempor vivamus tellus
-enim, suscipit quis eleifend. Amet class phasellus orci pretium, risus in nulla. Neque sit ullamcorper,
-ultricies platea id nec suspendisse ac. Et elementum. Dictum nam, ut dui fermentum egestas facilisis elit
-augue, adipiscing donec ipsum erat nam pellentesque convallis, vestibulum vestibulum risus id nulla ut mauris,
-curabitur aute aptent. Ultrices orci wisi dui ipsum praesent, pharetra felis eu quis. Est fringilla etiam,
-maxime sem dapibus et eget, mi enim dignissim nec pretium, augue vehicula, volutpat proin. Et occaecati
-lobortis viverra, cum in sed, vivamus tellus. Libero at malesuada est vivamus leo tortor.
-
-
-The simplescrollbars
addon defines two
-styles of non-native scrollbars: "simple"
and "overlay"
(click to try), which can be passed to
-the scrollbarStyle
option. These implement
-the scrollbar using DOM elements, allowing more control over
-its appearance .
-
-
-
diff --git a/release/libraries/codemirror/demo/spanaffectswrapping_shim.html b/release/libraries/codemirror/demo/spanaffectswrapping_shim.html
deleted file mode 100644
index 46667dd..0000000
--- a/release/libraries/codemirror/demo/spanaffectswrapping_shim.html
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-CodeMirror: Automatically derive odd wrapping behavior for your browser
-
-
-
-
-
-
-Automatically derive odd wrapping behavior for your browser
-
-
- This is a hack to automatically derive
- a spanAffectsWrapping
regexp for a browser. See the
- comments above that variable
- in lib/codemirror.js
- for some more details.
-
-
-
-
-
-
diff --git a/release/libraries/codemirror/demo/sublime.html b/release/libraries/codemirror/demo/sublime.html
deleted file mode 100644
index bfe17c5..0000000
--- a/release/libraries/codemirror/demo/sublime.html
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-CodeMirror: Sublime Text bindings demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Sublime Text bindings demo
-
-The sublime
keymap defines many Sublime Text-specific
-bindings for CodeMirror. See the code below for an overview.
-
-Enable the keymap by
-loading keymap/sublime.js
-and setting
-the keyMap
-option to "sublime"
.
-
-(A lot of the search functionality is still missing.)
-
-
-
-
diff --git a/release/libraries/codemirror/demo/tern.html b/release/libraries/codemirror/demo/tern.html
deleted file mode 100644
index e331fd5..0000000
--- a/release/libraries/codemirror/demo/tern.html
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-CodeMirror: Tern Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Tern Demo
-// Use ctrl-space to complete something
-// Put the cursor in or after an expression, press ctrl-o to
-// find its type
-
-var foo = ["array", "of", "strings"];
-var bar = foo.slice(0, 2).join("").split("a")[0];
-
-// Works for locally defined types too.
-
-function CTor() { this.size = 10; }
-CTor.prototype.hallo = "hallo";
-
-var baz = new CTor;
-baz.
-
-// You can press ctrl-q when the cursor is on a variable name to
-// rename it. Try it with CTor...
-
-// When the cursor is in an argument list, the arguments are
-// shown below the editor.
-
-[1].reduce( );
-
-// And a little more advanced code...
-
-(function(exports) {
- exports.randomElt = function(arr) {
- return arr[Math.floor(arr.length * Math.random())];
- };
- exports.strList = "foo".split("");
- exports.intList = exports.strList.map(function(s) { return s.charCodeAt(0); });
-})(window.myMod = {});
-
-var randomStr = myMod.randomElt(myMod.strList);
-var randomInt = myMod.randomElt(myMod.intList);
-
-
-Demonstrates integration of Tern
-and CodeMirror. The following keys are bound:
-
-
- Ctrl-Space Autocomplete
- Ctrl-O Find docs for the expression at the cursor
- Ctrl-I Find type at cursor
- Alt-. Jump to definition (Alt-, to jump back)
- Ctrl-Q Rename variable
- Ctrl-. Select all occurrences of a variable
-
-
-Documentation is sparse for now. See the top of
-the script for a rough API
-overview.
-
-
-
-
diff --git a/release/libraries/codemirror/demo/theme.html b/release/libraries/codemirror/demo/theme.html
deleted file mode 100644
index 1ccac88..0000000
--- a/release/libraries/codemirror/demo/theme.html
+++ /dev/null
@@ -1,200 +0,0 @@
-
-
-CodeMirror: Theme Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Theme Demo
-
-function findSequence(goal) {
- function find(start, history) {
- if (start == goal)
- return history;
- else if (start > goal)
- return null;
- else
- return find(start + 5, "(" + history + " + 5)") ||
- find(start * 3, "(" + history + " * 3)");
- }
- return find(1, "1");
-}
-
-Select a theme:
- default
- 3024-day
- 3024-night
- abbott
- abcdef
- ambiance
- ayu-dark
- ayu-mirage
- base16-dark
- base16-light
- bespin
- blackboard
- cobalt
- colorforth
- darcula
- dracula
- duotone-dark
- duotone-light
- eclipse
- elegant
- erlang-dark
- gruvbox-dark
- hopscotch
- icecoder
- idea
- isotope
- juejin
- lesser-dark
- liquibyte
- lucario
- material
- material-darker
- material-palenight
- material-ocean
- mbo
- mdn-like
- midnight
- monokai
- moxer
- neat
- neo
- night
- nord
- oceanic-next
- panda-syntax
- paraiso-dark
- paraiso-light
- pastel-on-dark
- railscasts
- rubyblue
- seti
- shadowfox
- solarized dark
- solarized light
- the-matrix
- tomorrow-night-bright
- tomorrow-night-eighties
- ttcn
- twilight
- vibrant-ink
- xq-dark
- xq-light
- yeti
- yonce
- zenburn
-
-
-
-
-
diff --git a/release/libraries/codemirror/demo/trailingspace.html b/release/libraries/codemirror/demo/trailingspace.html
deleted file mode 100644
index fb55399..0000000
--- a/release/libraries/codemirror/demo/trailingspace.html
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-CodeMirror: Trailing Whitespace Demo
-
-
-
-
-
-
-
-
-
-
-Trailing Whitespace Demo
-This text
- has some
-trailing whitespace!
-
-
-
-Uses
-the trailingspace
-addon to highlight trailing whitespace.
-
-
diff --git a/release/libraries/codemirror/demo/variableheight.html b/release/libraries/codemirror/demo/variableheight.html
deleted file mode 100644
index a3af5cf..0000000
--- a/release/libraries/codemirror/demo/variableheight.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-CodeMirror: Variable Height Demo
-
-
-
-
-
-
-
-
-
-
-
-Variable Height Demo
-# A First Level Header
-
-**Bold** text in a normal-size paragraph.
-
-And a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long, wrapped line with a piece of **big** text inside of it.
-
-## A Second Level Header
-
-Now is the time for all good men to come to
-the aid of their country. This is just a
-regular paragraph.
-
-The quick brown fox jumped over the lazy
-dog's back.
-
-### Header 3
-
-> This is a blockquote.
->
-> This is the second paragraph in the blockquote.
->
-> ## This is an H2 in a blockquote
-
-
-
diff --git a/release/libraries/codemirror/demo/vim.html b/release/libraries/codemirror/demo/vim.html
deleted file mode 100644
index 41406b4..0000000
--- a/release/libraries/codemirror/demo/vim.html
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-CodeMirror: Vim bindings demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Vim bindings demo
-
-Note: The CodeMirror vim bindings do not have an
-active maintainer. That means that if you report bugs in it, they are
-likely to go unanswered. It also means that if you want to help, you
-are very welcome to look
-at the
-open issues and see which ones you can solve.
-
-
-#include "syscalls.h"
-/* getchar: simple buffered version */
-int getchar(void)
-{
- static char buf[BUFSIZ];
- static char *bufp = buf;
- static int n = 0;
- if (n == 0) { /* buffer is empty */
- n = read(0, buf, sizeof buf);
- bufp = buf;
- }
- return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-
-Key buffer:
-Vim mode:
-
-The vim keybindings are enabled by including keymap/vim.js
and setting the
-keyMap
option to vim
.
-
-Features
-
-
- All common motions and operators, including text objects
- Operator motion orthogonality
- Visual mode - characterwise, linewise, blockwise
- Full macro support (q, @)
- Incremental highlighted search (/, ?, #, *, g#, g*)
- Search/replace with confirm (:substitute, :%s)
- Search history
- Jump lists (Ctrl-o, Ctrl-i)
- Key/command mapping with API (:map, :nmap, :vmap)
- Sort (:sort)
- Marks (`, ')
- :global
- Insert mode behaves identical to base CodeMirror
- Cross-buffer yank/paste
-
-
-For the full list of key mappings and Ex commands, refer to the
-defaultKeymap
and defaultExCommandMap
at the
-top of keymap/vim.js
.
-
-
Note that while the vim mode tries to emulate the most useful
-features of vim as faithfully as possible, it does not strive to
-become a complete vim implementation
-
-
-
-
diff --git a/release/libraries/codemirror/demo/visibletabs.html b/release/libraries/codemirror/demo/visibletabs.html
deleted file mode 100644
index f4f5a78..0000000
--- a/release/libraries/codemirror/demo/visibletabs.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-CodeMirror: Visible tabs demo
-
-
-
-
-
-
-
-
-
-
-Visible tabs demo
-
-#include "syscalls.h"
-/* getchar: simple buffered version */
-int getchar(void)
-{
- static char buf[BUFSIZ];
- static char *bufp = buf;
- static int n = 0;
- if (n == 0) { /* buffer is empty */
- n = read(0, buf, sizeof buf);
- bufp = buf;
- }
- return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-
-
-Tabs inside the editor are spans with the
-class cm-tab
, and can be styled.
-
-
-
-
diff --git a/release/libraries/codemirror/demo/widget.html b/release/libraries/codemirror/demo/widget.html
deleted file mode 100644
index 6fae2d2..0000000
--- a/release/libraries/codemirror/demo/widget.html
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-CodeMirror: Inline Widget Demo
-
-
-
-
-
-
-
-
-
-
-
-Inline Widget Demo
-
-
-
-
-This demo runs JSHint over the code
-in the editor (which is the script used on this page), and
-inserts line widgets to
-display the warnings that JSHint comes up with.
-
diff --git a/release/libraries/codemirror/demo/xmlcomplete.html b/release/libraries/codemirror/demo/xmlcomplete.html
deleted file mode 100644
index dbbc9ba..0000000
--- a/release/libraries/codemirror/demo/xmlcomplete.html
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-CodeMirror: XML Autocomplete Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-XML Autocomplete Demo
-
-
-
- Press ctrl-space , or type a '<' character to
- activate autocompletion. This demo defines a simple schema that
- guides completion. The schema can be customized—see
- the manual .
-
- Development of the xml-hint
addon was kindly
- sponsored
- by www.xperiment.mobi .
-
-
-
diff --git a/release/libraries/codemirror/doc/activebookmark.js b/release/libraries/codemirror/doc/activebookmark.js
deleted file mode 100644
index 407282d..0000000
--- a/release/libraries/codemirror/doc/activebookmark.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Kludge in HTML5 tag recognition in IE8
-document.createElement("section");
-document.createElement("article");
-
-(function() {
- if (!window.addEventListener) return;
- var pending = false, prevVal = null;
-
- function updateSoon() {
- if (!pending) {
- pending = true;
- setTimeout(update, 250);
- }
- }
-
- function update() {
- pending = false;
- var marks = document.getElementById("nav").getElementsByTagName("a"), found;
- for (var i = 0; i < marks.length; ++i) {
- var mark = marks[i], m;
- if (mark.getAttribute("data-default")) {
- if (found == null) found = i;
- } else if (m = mark.href.match(/#(.*)/)) {
- var ref = document.getElementById(m[1]);
- if (ref && ref.getBoundingClientRect().top < 50)
- found = i;
- }
- }
- if (found != null && found != prevVal) {
- prevVal = found;
- var lis = document.getElementById("nav").getElementsByTagName("li");
- for (var i = 0; i < lis.length; ++i) lis[i].className = "";
- for (var i = 0; i < marks.length; ++i) {
- if (found == i) {
- marks[i].className = "active";
- for (var n = marks[i]; n; n = n.parentNode)
- if (n.nodeName == "LI") n.className = "active";
- } else {
- marks[i].className = "";
- }
- }
- }
- }
-
- window.addEventListener("scroll", updateSoon);
- window.addEventListener("load", updateSoon);
- window.addEventListener("hashchange", function() {
- setTimeout(function() {
- var hash = document.location.hash, found = null, m;
- var marks = document.getElementById("nav").getElementsByTagName("a");
- for (var i = 0; i < marks.length; i++)
- if ((m = marks[i].href.match(/(#.*)/)) && m[1] == hash) { found = i; break; }
- if (found != null) for (var i = 0; i < marks.length; i++)
- marks[i].className = i == found ? "active" : "";
- }, 300);
- });
-})();
diff --git a/release/libraries/codemirror/doc/docs.css b/release/libraries/codemirror/doc/docs.css
deleted file mode 100644
index 17b9212..0000000
--- a/release/libraries/codemirror/doc/docs.css
+++ /dev/null
@@ -1,274 +0,0 @@
-@font-face {
- font-family: 'Source Sans Pro';
- font-style: normal;
- font-weight: 400;
- src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(//themes.googleusercontent.com/static/fonts/sourcesanspro/v5/ODelI1aHBYDBqgeIAH2zlBM0YzuT7MdOe03otPbuUS0.woff) format('woff');
-}
-
-body, html { margin: 0; padding: 0; height: 100%; }
-section, article { display: block; padding: 0; }
-
-body {
- background: #f8f8f8;
- font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
- line-height: 1.5;
-}
-
-p { margin-top: 0; }
-
-h2, h3, h1 {
- font-weight: normal;
- margin-bottom: .7em;
-}
-h1 { font-size: 140%; }
-h2 { font-size: 120%; }
-h3 { font-size: 110%; }
-article > h2:first-child, section:first-child > h2 { margin-top: 0; }
-
-#nav h1 {
- margin-right: 12px;
- margin-top: 0;
- margin-bottom: 2px;
- color: #d30707;
- letter-spacing: .5px;
-}
-
-a, a:visited, a:link, .quasilink {
- color: #A21313;
-}
-
-em {
- padding-right: 2px;
-}
-
-.quasilink {
- cursor: pointer;
-}
-
-article {
- max-width: 700px;
- margin: 0 0 0 160px;
- border-left: 2px solid #E30808;
- border-right: 1px solid #ddd;
- padding: 30px 50px 100px 50px;
- background: white;
- z-index: 2;
- position: relative;
- min-height: 100%;
- box-sizing: border-box;
- -moz-box-sizing: border-box;
-}
-
-#nav {
- position: fixed;
- padding-top: 30px;
- max-height: 100%;
- box-sizing: -moz-border-box;
- box-sizing: border-box;
- overflow-y: auto;
- left: 0; right: none;
- width: 160px;
- text-align: right;
- z-index: 1;
-}
-
-@media screen and (min-width: 1000px) {
- article {
- margin: 0 auto;
- }
- #nav {
- right: 50%;
- width: auto;
- border-right: 349px solid transparent;
- }
-}
-
-#nav ul {
- display: block;
- margin: 0; padding: 0;
- margin-bottom: 32px;
-}
-
-#nav a {
- text-decoration: none;
-}
-
-#nav li {
- display: block;
- margin-bottom: 4px;
-}
-
-#nav li ul {
- font-size: 80%;
- margin-bottom: 0;
- display: none;
-}
-
-#nav li.active ul {
- display: block;
-}
-
-#nav li li a {
- padding-right: 20px;
- display: inline-block;
-}
-
-#nav ul a {
- color: black;
- padding: 0 7px 1px 11px;
-}
-
-#nav ul a.active, #nav ul a:hover {
- border-bottom: 1px solid #E30808;
- margin-bottom: -1px;
- color: #E30808;
-}
-
-#logo {
- border: 0;
- margin-right: 12px;
- margin-bottom: 25px;
-}
-
-section {
- border-top: 1px solid #E30808;
- margin: 1.5em 0;
-}
-
-section.first {
- border: none;
- margin-top: 0;
-}
-
-#demo {
- position: relative;
-}
-
-#demolist {
- position: absolute;
- right: 5px;
- top: 5px;
- z-index: 25;
-}
-
-.yinyang {
- position: absolute;
- top: -10px;
- left: 0; right: 0;
- margin: auto;
- display: block;
- height: 120px;
-}
-
-.actions {
- margin: 1em 0 0;
- min-height: 100px;
- position: relative;
-}
-
-.actionspicture {
- pointer-events: none;
- position: absolute;
- height: 100px;
- top: 0; left: 0; right: 0;
-}
-
-.actionlink {
- pointer-events: auto;
- font-family: arial;
- font-size: 80%;
- font-weight: bold;
- position: absolute;
- top: 0; bottom: 0;
- line-height: 1;
- height: 1em;
- margin: auto;
-}
-
-.actionlink.download {
- color: white;
- right: 50%;
- margin-right: 13px;
- text-shadow: -1px 1px 3px #b00, -1px -1px 3px #b00, 1px 0px 3px #b00;
-}
-
-.actionlink.fund {
- color: #b00;
- left: 50%;
- margin-left: 15px;
-}
-
-.actionlink:hover {
- text-decoration: underline;
-}
-
-.actionlink a {
- color: inherit;
-}
-
-.actionsleft {
- float: left;
-}
-
-.actionsright {
- float: right;
- text-align: right;
-}
-
-@media screen and (max-width: 800px) {
- .actions {
- padding-top: 120px;
- }
- .actionsleft, .actionsright {
- float: none;
- text-align: left;
- margin-bottom: 1em;
- }
-}
-
-th {
- text-decoration: underline;
- font-weight: normal;
- text-align: left;
-}
-
-#features ul {
- list-style: none;
- margin: 0 0 1em;
- padding: 0 0 0 1.2em;
-}
-
-#features li:before {
- content: "-";
- width: 1em;
- display: inline-block;
- padding: 0;
- margin: 0;
- margin-left: -1em;
-}
-
-.rel {
- margin-bottom: 0;
-}
-.rel-note {
- margin-top: 0;
- color: #555;
-}
-
-pre {
- padding-left: 15px;
- border-left: 2px solid #ddd;
-}
-
-code {
- padding: 0 2px;
-}
-
-strong {
- text-decoration: underline;
- font-weight: normal;
-}
-
-.field {
- border: 1px solid #A21313;
-}
diff --git a/release/libraries/codemirror/doc/internals.html b/release/libraries/codemirror/doc/internals.html
deleted file mode 100644
index 893604e..0000000
--- a/release/libraries/codemirror/doc/internals.html
+++ /dev/null
@@ -1,504 +0,0 @@
-
-
-CodeMirror: Internals
-
-
-
-
-
-
-
-
-
-(Re-) Implementing A Syntax-Highlighting Editor in JavaScript
-
-
- Topic: JavaScript, code editor implementation
- Author: Marijn Haverbeke
- Date: March 2nd 2011 (updated November 13th 2011)
-
-
-Caution : this text was written briefly after
-version 2 was initially written. It no longer (even including the
-update at the bottom) fully represents the current implementation. I'm
-leaving it here as a historic document. For more up-to-date
-information, look at the entries
-tagged cm-internals
-on my blog.
-
-This is a followup to
-my Brutal Odyssey to the
-Dark Side of the DOM Tree story. That one describes the
-mind-bending process of implementing (what would become) CodeMirror 1.
-This one describes the internals of CodeMirror 2, a complete rewrite
-and rethink of the old code base. I wanted to give this piece another
-Hunter Thompson copycat subtitle, but somehow that would be out of
-place—the process this time around was one of straightforward
-engineering, requiring no serious mind-bending whatsoever.
-
-So, what is wrong with CodeMirror 1? I'd estimate, by mailing list
-activity and general search-engine presence, that it has been
-integrated into about a thousand systems by now. The most prominent
-one, since a few weeks,
-being Google
-code's project hosting . It works, and it's being used widely.
-
-Still, I did not start replacing it because I was bored. CodeMirror
-1 was heavily reliant on designMode
-or contentEditable
(depending on the browser). Neither of
-these are well specified (HTML5 tries
-to specify
-their basics), and, more importantly, they tend to be one of the more
-obscure and buggy areas of browser functionality—CodeMirror, by using
-this functionality in a non-typical way, was constantly running up
-against browser bugs. WebKit wouldn't show an empty line at the end of
-the document, and in some releases would suddenly get unbearably slow.
-Firefox would show the cursor in the wrong place. Internet Explorer
-would insist on linkifying everything that looked like a URL or email
-address, a behaviour that can't be turned off. Some bugs I managed to
-work around (which was often a frustrating, painful process), others,
-such as the Firefox cursor placement, I gave up on, and had to tell
-user after user that they were known problems, but not something I
-could help.
-
-Also, there is the fact that designMode
(which seemed
-to be less buggy than contentEditable
in Webkit and
-Firefox, and was thus used by CodeMirror 1 in those browsers) requires
-a frame. Frames are another tricky area. It takes some effort to
-prevent getting tripped up by domain restrictions, they don't
-initialize synchronously, behave strangely in response to the back
-button, and, on several browsers, can't be moved around the DOM
-without having them re-initialize. They did provide a very nice way to
-namespace the library, though—CodeMirror 1 could freely pollute the
-namespace inside the frame.
-
-Finally, working with an editable document means working with
-selection in arbitrary DOM structures. Internet Explorer (8 and
-before) has an utterly different (and awkward) selection API than all
-of the other browsers, and even among the different implementations of
-document.selection
, details about how exactly a selection
-is represented vary quite a bit. Add to that the fact that Opera's
-selection support tended to be very buggy until recently, and you can
-imagine why CodeMirror 1 contains 700 lines of selection-handling
-code.
-
-And that brings us to the main issue with the CodeMirror 1
-code base: The proportion of browser-bug-workarounds to real
-application code was getting dangerously high. By building on top of a
-few dodgy features, I put the system in a vulnerable position—any
-incompatibility and bugginess in these features, I had to paper over
-with my own code. Not only did I have to do some serious stunt-work to
-get it to work on older browsers (as detailed in the
-previous story ), things
-also kept breaking in newly released versions, requiring me to come up
-with new scary hacks in order to keep up. This was starting
-to lose its appeal.
-
-
- General Approach
-
-What CodeMirror 2 does is try to sidestep most of the hairy hacks
-that came up in version 1. I owe a lot to the
-ACE editor for inspiration on how to
-approach this.
-
-I absolutely did not want to be completely reliant on key events to
-generate my input. Every JavaScript programmer knows that key event
-information is horrible and incomplete. Some people (most awesomely
-Mihai Bazon with Ymacs ) have been able
-to build more or less functioning editors by directly reading key
-events, but it takes a lot of work (the kind of never-ending, fragile
-work I described earlier), and will never be able to properly support
-things like multi-keystoke international character
-input. [see below for caveat]
-
-So what I do is focus a hidden textarea, and let the browser
-believe that the user is typing into that. What we show to the user is
-a DOM structure we built to represent his document. If this is updated
-quickly enough, and shows some kind of believable cursor, it feels
-like a real text-input control.
-
-Another big win is that this DOM representation does not have to
-span the whole document. Some CodeMirror 1 users insisted that they
-needed to put a 30 thousand line XML document into CodeMirror. Putting
-all that into the DOM takes a while, especially since, for some
-reason, an editable DOM tree is slower than a normal one on most
-browsers. If we have full control over what we show, we must only
-ensure that the visible part of the document has been added, and can
-do the rest only when needed. (Fortunately, the onscroll
-event works almost the same on all browsers, and lends itself well to
-displaying things only as they are scrolled into view.)
-
-
-
- Selection
-
-Getting and setting the selection range of a textarea in modern
-browsers is trivial—you just use the selectionStart
-and selectionEnd
properties. On IE you have to do some
-insane stuff with temporary ranges and compensating for the fact that
-moving the selection by a 'character' will treat \r\n as a single
-character, but even there it is possible to build functions that
-reliably set and get the selection range.
-
-But consider this typical case: When I'm somewhere in my document,
-press shift, and press the up arrow, something gets selected. Then, if
-I, still holding shift, press the up arrow again, the top of my
-selection is adjusted. The selection remembers where its head
-and its anchor are, and moves the head when we shift-move.
-This is a generally accepted property of selections, and done right by
-every editing component built in the past twenty years.
-
-But not something that the browser selection APIs expose.
-
-Great. So when someone creates an 'upside-down' selection, the next
-time CodeMirror has to update the textarea, it'll re-create the
-selection as an 'upside-up' selection, with the anchor at the top, and
-the next cursor motion will behave in an unexpected way—our second
-up-arrow press in the example above will not do anything, since it is
-interpreted in exactly the same way as the first.
-
-No problem. We'll just, ehm, detect that the selection is
-upside-down (you can tell by the way it was created), and then, when
-an upside-down selection is present, and a cursor-moving key is
-pressed in combination with shift, we quickly collapse the selection
-in the textarea to its start, allow the key to take effect, and then
-combine its new head with its old anchor to get the real
-selection.
-
-In short, scary hacks could not be avoided entirely in CodeMirror
-2.
-
-And, the observant reader might ask, how do you even know that a
-key combo is a cursor-moving combo, if you claim you support any
-native key bindings? Well, we don't, but we can learn. The editor
-keeps a set known cursor-movement combos (initialized to the
-predictable defaults), and updates this set when it observes that
-pressing a certain key had (only) the effect of moving the cursor.
-This, of course, doesn't work if the first time the key is used was
-for extending an inverted selection, but it works most of the
-time.
-
-
- Intelligent Updating
-
-One thing that always comes up when you have a complicated internal
-state that's reflected in some user-visible external representation
-(in this case, the displayed code and the textarea's content) is
-keeping the two in sync. The naive way is to just update the display
-every time you change your state, but this is not only error prone
-(you'll forget), it also easily leads to duplicate work on big,
-composite operations. Then you start passing around flags indicating
-whether the display should be updated in an attempt to be efficient
-again and, well, at that point you might as well give up completely.
-
-I did go down that road, but then switched to a much simpler model:
-simply keep track of all the things that have been changed during an
-action, and then, only at the end, use this information to update the
-user-visible display.
-
-CodeMirror uses a concept of operations , which start by
-calling a specific set-up function that clears the state and end by
-calling another function that reads this state and does the required
-updating. Most event handlers, and all the user-visible methods that
-change state are wrapped like this. There's a method
-called operation
that accepts a function, and returns
-another function that wraps the given function as an operation.
-
-It's trivial to extend this (as CodeMirror does) to detect nesting,
-and, when an operation is started inside an operation, simply
-increment the nesting count, and only do the updating when this count
-reaches zero again.
-
-If we have a set of changed ranges and know the currently shown
-range, we can (with some awkward code to deal with the fact that
-changes can add and remove lines, so we're dealing with a changing
-coordinate system) construct a map of the ranges that were left
-intact. We can then compare this map with the part of the document
-that's currently visible (based on scroll offset and editor height) to
-determine whether something needs to be updated.
-
-CodeMirror uses two update algorithms—a full refresh, where it just
-discards the whole part of the DOM that contains the edited text and
-rebuilds it, and a patch algorithm, where it uses the information
-about changed and intact ranges to update only the out-of-date parts
-of the DOM. When more than 30 percent (which is the current heuristic,
-might change) of the lines need to be updated, the full refresh is
-chosen (since it's faster to do than painstakingly finding and
-updating all the changed lines), in the other case it does the
-patching (so that, if you scroll a line or select another character,
-the whole screen doesn't have to be
-re-rendered). [the full-refresh
-algorithm was dropped, it wasn't really faster than the patching
-one]
-
-All updating uses innerHTML
rather than direct DOM
-manipulation, since that still seems to be by far the fastest way to
-build documents. There's a per-line function that combines the
-highlighting, marking , and
-selection info for that line into a snippet of HTML. The patch updater
-uses this to reset individual lines, the refresh updater builds an
-HTML chunk for the whole visible document at once, and then uses a
-single innerHTML
update to do the refresh.
-
-
- Parsers can be Simple
-
-When I wrote CodeMirror 1, I
-thought interruptible
-parsers were a hugely scary and complicated thing, and I used a
-bunch of heavyweight abstractions to keep this supposed complexity
-under control: parsers
-were iterators
-that consumed input from another iterator, and used funny
-closure-resetting tricks to copy and resume themselves.
-
-This made for a rather nice system, in that parsers formed strictly
-separate modules, and could be composed in predictable ways.
-Unfortunately, it was quite slow (stacking three or four iterators on
-top of each other), and extremely intimidating to people not used to a
-functional programming style.
-
-With a few small changes, however, we can keep all those
-advantages, but simplify the API and make the whole thing less
-indirect and inefficient. CodeMirror
-2's mode API uses explicit state
-objects, and makes the parser/tokenizer a function that simply takes a
-state and a character stream abstraction, advances the stream one
-token, and returns the way the token should be styled. This state may
-be copied, optionally in a mode-defined way, in order to be able to
-continue a parse at a given point. Even someone who's never touched a
-lambda in his life can understand this approach. Additionally, far
-fewer objects are allocated in the course of parsing now.
-
-The biggest speedup comes from the fact that the parsing no longer
-has to touch the DOM though. In CodeMirror 1, on an older browser, you
-could see the parser work its way through the document,
-managing some twenty lines in each 50-millisecond time slice it got. It
-was reading its input from the DOM, and updating the DOM as it went
-along, which any experienced JavaScript programmer will immediately
-spot as a recipe for slowness. In CodeMirror 2, the parser usually
-finishes the whole document in a single 100-millisecond time slice—it
-manages some 1500 lines during that time on Chrome. All it has to do
-is munge strings, so there is no real reason for it to be slow
-anymore.
-
-
- What Gives?
-
-Given all this, what can you expect from CodeMirror 2?
-
-
-
-Small. the base library is
-some 45k when minified
-now, 17k when gzipped. It's smaller than
-its own logo.
-
-Lightweight. CodeMirror 2 initializes very
-quickly, and does almost no work when it is not focused. This means
-you can treat it almost like a textarea, have multiple instances on a
-page without trouble.
-
-Huge document support. Since highlighting is
-really fast, and no DOM structure is being built for non-visible
-content, you don't have to worry about locking up your browser when a
-user enters a megabyte-sized document.
-
-Extended API. Some things kept coming up in the
-mailing list, such as marking pieces of text or lines, which were
-extremely hard to do with CodeMirror 1. The new version has proper
-support for these built in.
-
-Tab support. Tabs inside editable documents were,
-for some reason, a no-go. At least six different people announced they
-were going to add tab support to CodeMirror 1, none survived (I mean,
-none delivered a working version). CodeMirror 2 no longer removes tabs
-from your document.
-
-Sane styling. iframe
nodes aren't
-really known for respecting document flow. Now that an editor instance
-is a plain div
element, it is much easier to size it to
-fit the surrounding elements. You don't even have to make it scroll if
-you do not want to .
-
-
-
-On the downside, a CodeMirror 2 instance is not a native
-editable component. Though it does its best to emulate such a
-component as much as possible, there is functionality that browsers
-just do not allow us to hook into. Doing select-all from the context
-menu, for example, is not currently detected by CodeMirror.
-
-[Updates from November 13th 2011] Recently, I've made
-some changes to the codebase that cause some of the text above to no
-longer be current. I've left the text intact, but added markers at the
-passages that are now inaccurate. The new situation is described
-below.
-
-
- Content Representation
-
-The original implementation of CodeMirror 2 represented the
-document as a flat array of line objects. This worked well—splicing
-arrays will require the part of the array after the splice to be
-moved, but this is basically just a simple memmove
of a
-bunch of pointers, so it is cheap even for huge documents.
-
-However, I recently added line wrapping and code folding (line
-collapsing, basically). Once lines start taking up a non-constant
-amount of vertical space, looking up a line by vertical position
-(which is needed when someone clicks the document, and to determine
-the visible part of the document during scrolling) can only be done
-with a linear scan through the whole array, summing up line heights as
-you go. Seeing how I've been going out of my way to make big documents
-fast, this is not acceptable.
-
-The new representation is based on a B-tree. The leaves of the tree
-contain arrays of line objects, with a fixed minimum and maximum size,
-and the non-leaf nodes simply hold arrays of child nodes. Each node
-stores both the amount of lines that live below them and the vertical
-space taken up by these lines. This allows the tree to be indexed both
-by line number and by vertical position, and all access has
-logarithmic complexity in relation to the document size.
-
-I gave line objects and tree nodes parent pointers, to the node
-above them. When a line has to update its height, it can simply walk
-these pointers to the top of the tree, adding or subtracting the
-difference in height from each node it encounters. The parent pointers
-also make it cheaper (in complexity terms, the difference is probably
-tiny in normal-sized documents) to find the current line number when
-given a line object. In the old approach, the whole document array had
-to be searched. Now, we can just walk up the tree and count the sizes
-of the nodes coming before us at each level.
-
-I chose B-trees, not regular binary trees, mostly because they
-allow for very fast bulk insertions and deletions. When there is a big
-change to a document, it typically involves adding, deleting, or
-replacing a chunk of subsequent lines. In a regular balanced tree, all
-these inserts or deletes would have to be done separately, which could
-be really expensive. In a B-tree, to insert a chunk, you just walk
-down the tree once to find where it should go, insert them all in one
-shot, and then break up the node if needed. This breaking up might
-involve breaking up nodes further up, but only requires a single pass
-back up the tree. For deletion, I'm somewhat lax in keeping things
-balanced—I just collapse nodes into a leaf when their child count goes
-below a given number. This means that there are some weird editing
-patterns that may result in a seriously unbalanced tree, but even such
-an unbalanced tree will perform well, unless you spend a day making
-strangely repeating edits to a really big document.
-
-
- Keymaps
-
-Above , I claimed that directly catching key
-events for things like cursor movement is impractical because it
-requires some browser-specific kludges. I then proceeded to explain
-some awful hacks that were needed to make it
-possible for the selection changes to be detected through the
-textarea. In fact, the second hack is about as bad as the first.
-
-On top of that, in the presence of user-configurable tab sizes and
-collapsed and wrapped lines, lining up cursor movement in the textarea
-with what's visible on the screen becomes a nightmare. Thus, I've
-decided to move to a model where the textarea's selection is no longer
-depended on.
-
-So I moved to a model where all cursor movement is handled by my
-own code. This adds support for a goal column, proper interaction of
-cursor movement with collapsed lines, and makes it possible for
-vertical movement to move through wrapped lines properly, instead of
-just treating them like non-wrapped lines.
-
-The key event handlers now translate the key event into a string,
-something like Ctrl-Home
or Shift-Cmd-R
, and
-use that string to look up an action to perform. To make keybinding
-customizable, this lookup goes through
-a table , using a scheme that
-allows such tables to be chained together (for example, the default
-Mac bindings fall through to a table named 'emacsy', which defines
-basic Emacs-style bindings like Ctrl-F
, and which is also
-used by the custom Emacs bindings).
-
-A new
-option extraKeys
-allows ad-hoc keybindings to be defined in a much nicer way than what
-was possible with the
-old onKeyEvent
-callback. You simply provide an object mapping key identifiers to
-functions, instead of painstakingly looking at raw key events.
-
-Built-in commands map to strings, rather than functions, for
-example "goLineUp"
is the default action bound to the up
-arrow key. This allows new keymaps to refer to them without
-duplicating any code. New commands can be defined by assigning to
-the CodeMirror.commands
object, which maps such commands
-to functions.
-
-The hidden textarea now only holds the current selection, with no
-extra characters around it. This has a nice advantage: polling for
-input becomes much, much faster. If there's a big selection, this text
-does not have to be read from the textarea every time—when we poll,
-just noticing that something is still selected is enough to tell us
-that no new text was typed.
-
-The reason that cheap polling is important is that many browsers do
-not fire useful events on IME (input method engine) input, which is
-the thing where people inputting a language like Japanese or Chinese
-use multiple keystrokes to create a character or sequence of
-characters. Most modern browsers fire input
when the
-composing is finished, but many don't fire anything when the character
-is updated during composition. So we poll, whenever the
-editor is focused, to provide immediate updates of the display.
-
-
-
diff --git a/release/libraries/codemirror/doc/logo.png b/release/libraries/codemirror/doc/logo.png
deleted file mode 100644
index 9aabda1..0000000
Binary files a/release/libraries/codemirror/doc/logo.png and /dev/null differ
diff --git a/release/libraries/codemirror/doc/logo.svg b/release/libraries/codemirror/doc/logo.svg
deleted file mode 100644
index b39b24c..0000000
--- a/release/libraries/codemirror/doc/logo.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/release/libraries/codemirror/doc/logos/4me.svg b/release/libraries/codemirror/doc/logos/4me.svg
deleted file mode 100644
index 8e894ee..0000000
--- a/release/libraries/codemirror/doc/logos/4me.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/anvil.png b/release/libraries/codemirror/doc/logos/anvil.png
deleted file mode 100644
index 7cb2ab1..0000000
Binary files a/release/libraries/codemirror/doc/logos/anvil.png and /dev/null differ
diff --git a/release/libraries/codemirror/doc/logos/artcompiler.svg b/release/libraries/codemirror/doc/logos/artcompiler.svg
deleted file mode 100644
index d8349a1..0000000
--- a/release/libraries/codemirror/doc/logos/artcompiler.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/cargo.svg b/release/libraries/codemirror/doc/logos/cargo.svg
deleted file mode 100644
index 0690183..0000000
--- a/release/libraries/codemirror/doc/logos/cargo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/codepen.svg b/release/libraries/codemirror/doc/logos/codepen.svg
deleted file mode 100644
index cc3d127..0000000
--- a/release/libraries/codemirror/doc/logos/codepen.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/desmos.svg b/release/libraries/codemirror/doc/logos/desmos.svg
deleted file mode 100644
index b47e4d9..0000000
--- a/release/libraries/codemirror/doc/logos/desmos.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/executeprogram.svg b/release/libraries/codemirror/doc/logos/executeprogram.svg
deleted file mode 100644
index 0f75b69..0000000
--- a/release/libraries/codemirror/doc/logos/executeprogram.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/holmusk.svg b/release/libraries/codemirror/doc/logos/holmusk.svg
deleted file mode 100644
index 80d1882..0000000
--- a/release/libraries/codemirror/doc/logos/holmusk.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/jetbrains.svg b/release/libraries/codemirror/doc/logos/jetbrains.svg
deleted file mode 100644
index b379536..0000000
--- a/release/libraries/codemirror/doc/logos/jetbrains.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/observable.svg b/release/libraries/codemirror/doc/logos/observable.svg
deleted file mode 100644
index 49c3a82..0000000
--- a/release/libraries/codemirror/doc/logos/observable.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/primo.svg b/release/libraries/codemirror/doc/logos/primo.svg
deleted file mode 100644
index ec2f3de..0000000
--- a/release/libraries/codemirror/doc/logos/primo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/logos/prisma.svg b/release/libraries/codemirror/doc/logos/prisma.svg
deleted file mode 100644
index 6249376..0000000
--- a/release/libraries/codemirror/doc/logos/prisma.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/release/libraries/codemirror/doc/manual.html b/release/libraries/codemirror/doc/manual.html
deleted file mode 100644
index d549095..0000000
--- a/release/libraries/codemirror/doc/manual.html
+++ /dev/null
@@ -1,3761 +0,0 @@
-
-
-CodeMirror: User Manual
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- User manual and reference guide
- version 5.65.0
-
-
- CodeMirror is a code-editor component that can be embedded in
- Web pages. The core library provides only the editor
- component, no accompanying buttons, auto-completion, or other IDE
- functionality. It does provide a rich API on top of which such
- functionality can be straightforwardly implemented. See
- the addons included in the distribution,
- and 3rd party
- packages on npm , for reusable implementations of extra
- features.
-
- CodeMirror works with language-specific modes. Modes are
- JavaScript programs that help color (and optionally indent) text
- written in a given language. The distribution comes with a number
- of modes (see the mode/
- directory), and it isn't hard to write new
- ones for other languages.
-
-
-
- Basic Usage
-
- The easiest way to use CodeMirror is to simply load the script
- and style sheet found under lib/
in the distribution,
- plus a mode script from one of the mode/
directories.
- For example:
-
- <script src="lib/codemirror.js"></script>
-<link rel="stylesheet" href="lib/codemirror.css">
-<script src="mode/javascript/javascript.js"></script>
-
- (Alternatively, use a module loader. More
- about that later. )
-
- Having done this, an editor instance can be created like
- this:
-
- var myCodeMirror = CodeMirror(document.body);
-
- The editor will be appended to the document body, will start
- empty, and will use the mode that we loaded. To have more control
- over the new editor, a configuration object can be passed
- to CodeMirror
as a second
- argument:
-
- var myCodeMirror = CodeMirror(document.body, {
- value: "function myScript(){return 100;}\n",
- mode: "javascript"
-});
-
- This will initialize the editor with a piece of code already in
- it, and explicitly tell it to use the JavaScript mode (which is
- useful when multiple modes are loaded).
- See below for a full discussion of the
- configuration options that CodeMirror accepts.
-
- In cases where you don't want to append the editor to an
- element, and need more control over the way it is inserted, the
- first argument to the CodeMirror
function can also
- be a function that, when given a DOM element, inserts it into the
- document somewhere. This could be used to, for example, replace a
- textarea with a real editor:
-
- var myCodeMirror = CodeMirror(function(elt) {
- myTextArea.parentNode.replaceChild(elt, myTextArea);
-}, {value: myTextArea.value});
-
- However, for this use case, which is a common way to use
- CodeMirror, the library provides a much more powerful
- shortcut:
-
- var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
-
- This will, among other things, ensure that the textarea's value
- is updated with the editor's contents when the form (if it is part
- of a form) is submitted. See the API
- reference for a full description of this method.
-
- Module loaders
-
- The files in the CodeMirror distribution contain shims for
- loading them (and their dependencies) in AMD or CommonJS
- environments. If the variables exports
- and module
exist and have type object, CommonJS-style
- require will be used. If not, but there is a
- function define
with an amd
property
- present, AMD-style (RequireJS) will be used.
-
- It is possible to
- use Browserify or similar
- tools to statically build modules using CodeMirror. Alternatively,
- use RequireJS to dynamically
- load dependencies at runtime. Both of these approaches have the
- advantage that they don't use the global namespace and can, thus,
- do things like load multiple versions of CodeMirror alongside each
- other.
-
- Here's a simple example of using RequireJS to load CodeMirror:
-
- require([
- "cm/lib/codemirror", "cm/mode/htmlmixed/htmlmixed"
-], function(CodeMirror) {
- CodeMirror.fromTextArea(document.getElementById("code"), {
- lineNumbers: true,
- mode: "htmlmixed"
- });
-});
-
- It will automatically load the modes that the mixed HTML mode
- depends on (XML, JavaScript, and CSS). Do not use
- RequireJS' paths
option to configure the path to
- CodeMirror, since it will break loading submodules through
- relative paths. Use
- the packages
- configuration option instead, as in:
-
- require.config({
- packages: [{
- name: "codemirror",
- location: "../path/to/codemirror",
- main: "lib/codemirror"
- }]
-});
-
-
-
-
- Configuration
-
- Both the CodeMirror
- function and its fromTextArea
method take as second
- (optional) argument an object containing configuration options.
- Any option not supplied like this will be taken
- from CodeMirror.defaults
, an
- object containing the default options. You can update this object
- to change the defaults on your page.
-
- Options are not checked in any way, so setting bogus option
- values is bound to lead to odd errors.
-
- These are the supported options:
-
-
- value : string|CodeMirror.Doc
- The starting value of the editor. Can be a string, or
- a document object .
-
- mode : string|object
- The mode to use. When not given, this will default to the
- first mode that was loaded. It may be a string, which either
- simply names the mode or is
- a MIME type
- associated with the mode. The value "null"
- indicates no highlighting should be applied. Alternatively, it
- may be an object containing configuration options for the mode,
- with a name
property that names the mode (for
- example {name: "javascript", json: true}
). The demo
- pages for each mode contain information about what configuration
- parameters the mode supports. You can ask CodeMirror which modes
- and MIME types have been defined by inspecting
- the CodeMirror.modes
- and CodeMirror.mimeModes
objects. The first maps
- mode names to their constructors, and the second maps MIME types
- to mode specs.
-
- lineSeparator : string|null
- Explicitly set the line separator for the editor. By default
- (value null
), the document will be split on CRLFs
- as well as lone CRs and LFs, and a single LF will be used as
- line separator in all output (such
- as getValue
). When a
- specific string is given, lines will only be split on that
- string, and output will, by default, use that same
- separator.
-
- theme : string
- The theme to style the editor with. You must make sure the
- CSS file defining the corresponding .cm-s-[name]
- styles is loaded (see
- the theme
directory in the
- distribution). The default is "default"
, for which
- colors are included in codemirror.css
. It is
- possible to use multiple theming classes at once—for
- example "foo bar"
will assign both
- the cm-s-foo
and the cm-s-bar
classes
- to the editor.
-
- indentUnit : integer
- How many spaces a block (whatever that means in the edited
- language) should be indented. The default is 2.
-
- smartIndent : boolean
- Whether to use the context-sensitive indentation that the
- mode provides (or just indent the same as the line before).
- Defaults to true.
-
- tabSize : integer
- The width of a tab character. Defaults to 4.
-
- indentWithTabs : boolean
- Whether, when indenting, the first N*tabSize
- spaces should be replaced by N tabs. Default is false.
-
- electricChars : boolean
- Configures whether the editor should re-indent the current
- line when a character is typed that might change its proper
- indentation (only works if the mode supports indentation).
- Default is true.
-
- specialChars : RegExp
- A regular expression used to determine which characters
- should be replaced by a
- special placeholder .
- Mostly useful for non-printing special characters. The default
- is /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/
.
- specialCharPlaceholder : function(char) → Element
- A function that, given a special character identified by
- the specialChars
- option, produces a DOM node that is used to represent the
- character. By default, a red dot (• )
- is shown, with a title tooltip to indicate the character code.
-
- direction : "ltr" | "rtl"
- Flips overall layout and selects base paragraph direction to
- be left-to-right or right-to-left. Default is "ltr".
- CodeMirror applies the Unicode Bidirectional Algorithm to each
- line, but does not autodetect base direction — it's set to the
- editor direction for all lines. The resulting order is
- sometimes wrong when base direction doesn't match user intent
- (for example, leading and trailing punctuation jumps to the
- wrong side of the line). Therefore, it's helpful for
- multilingual input to let users toggle this option.
-
- rtlMoveVisually : boolean
- Determines whether horizontal cursor movement through
- right-to-left (Arabic, Hebrew) text is visual (pressing the left
- arrow moves the cursor left) or logical (pressing the left arrow
- moves to the next lower index in the string, which is visually
- right in right-to-left text). The default is false
- on Windows, and true
on other platforms.
-
- keyMap : string
- Configures the key map to use. The default
- is "default"
, which is the only key map defined
- in codemirror.js
itself. Extra key maps are found in
- the key map
directory. See
- the section on key maps for more
- information.
-
-
- Can be used to specify extra key bindings for the editor,
- alongside the ones defined
- by keyMap
. Should be
- either null, or a valid key map value.
-
- configureMouse : fn(cm: CodeMirror, repeat: "single" | "double" | "triple", event: Event) → Object
- Allows you to configure the behavior of mouse selection and
- dragging. The function is called when the left mouse button is
- pressed. The returned object may have the following properties:
-
- unit : "char" | "word" | "line" | "rectangle" | fn(CodeMirror, Pos) → {from: Pos, to: Pos}
- The unit by which to select. May be one of the built-in
- units or a function that takes a position and returns a
- range around that, for a custom unit. The default is to
- return "word"
for double
- clicks, "line"
for triple
- clicks, "rectangle"
for alt-clicks (or, on
- Chrome OS, meta-shift-clicks), and "single"
- otherwise.
- extend : bool
- Whether to extend the existing selection range or start
- a new one. By default, this is enabled when shift
- clicking.
- addNew : bool
- When enabled, this adds a new range to the existing
- selection, rather than replacing it. The default behavior is
- to enable this for command-click on Mac OS, and
- control-click on other platforms.
- moveOnDrag : bool
- When the mouse even drags content around inside the
- editor, this controls whether it is copied (false) or moved
- (true). By default, this is enabled by alt-clicking on Mac
- OS, and ctrl-clicking elsewhere.
-
-
-
- lineWrapping : boolean
- Whether CodeMirror should scroll or wrap for long lines.
- Defaults to false
(scroll).
-
- lineNumbers : boolean
- Whether to show line numbers to the left of the editor.
-
- firstLineNumber : integer
- At which number to start counting lines. Default is 1.
-
- lineNumberFormatter : function(line: integer) → string
- A function used to format line numbers. The function is
- passed the line number, and should return a string that will be
- shown in the gutter.
-
- gutters : array<string | {className: string, style: ?string}>
- Can be used to add extra gutters (beyond or instead of the
- line number gutter). Should be an array of CSS class names or
- class name / CSS string pairs, each of which defines
- a width
(and optionally a background), and which
- will be used to draw the background of the gutters. May
- include the CodeMirror-linenumbers
class, in order
- to explicitly set the position of the line number gutter (it
- will default to be to the right of all other gutters). These
- class names are the keys passed
- to setGutterMarker
.
-
- fixedGutter : boolean
- Determines whether the gutter scrolls along with the content
- horizontally (false) or whether it stays fixed during horizontal
- scrolling (true, the default).
-
- scrollbarStyle : string
- Chooses a scrollbar implementation. The default
- is "native"
, showing native scrollbars. The core
- library also provides the "null"
style, which
- completely hides the
- scrollbars. Addons can
- implement additional scrollbar models.
-
- coverGutterNextToScrollbar : boolean
- When fixedGutter
- is on, and there is a horizontal scrollbar, by default the
- gutter will be visible to the left of this scrollbar. If this
- option is set to true, it will be covered by an element with
- class CodeMirror-gutter-filler
.
-
- inputStyle : string
- Selects the way CodeMirror handles input and focus. The core
- library defines the "textarea"
- and "contenteditable"
input models. On mobile
- browsers, the default is "contenteditable"
. On
- desktop browsers, the default is "textarea"
.
- Support for IME and screen readers is better in
- the "contenteditable"
model. The intention is to
- make it the default on modern desktop browsers in the
- future.
-
- readOnly : boolean|string
- This disables editing of the editor content by the user. If
- the special value "nocursor"
is given (instead of
- simply true
), focusing of the editor is also
- disallowed.
-
- screenReaderLabel : string
- This label is read by the screenreaders when CodeMirror text area is focused. This
- is helpful for accessibility.
-
- showCursorWhenSelecting : boolean
- Whether the cursor should be drawn when a selection is
- active. Defaults to false.
-
- lineWiseCopyCut : boolean
- When enabled, which is the default, doing copy or cut when
- there is no selection will copy or cut the whole lines that have
- cursors on them.
-
- pasteLinesPerSelection : boolean
- When pasting something from an external source (not from the
- editor itself), if the number of lines matches the number of
- selection, CodeMirror will by default insert one line per
- selection. You can set this to false
to disable
- that behavior.
-
- selectionsMayTouch : boolean
- Determines whether multiple selections are joined as soon as
- they touch (the default) or only when they overlap (true).
-
- undoDepth : integer
- The maximum number of undo levels that the editor stores.
- Note that this includes selection change events. Defaults to
- 200.
-
- historyEventDelay : integer
- The period of inactivity (in milliseconds) that will cause a
- new history event to be started when typing or deleting.
- Defaults to 1250.
-
- tabindex : integer
- The tab
- index to assign to the editor. If not given, no tab index
- will be assigned.
-
- autofocus : boolean
- Can be used to make CodeMirror focus itself on
- initialization. Defaults to off.
- When fromTextArea
is
- used, and no explicit value is given for this option, it will be
- set to true when either the source textarea is focused, or it
- has an autofocus
attribute and no other element is
- focused.
-
- phrases : ?object
- Some addons run user-visible strings (such as labels in the
- interface) through the phrase
- method to allow for translation. This option determines the
- return value of that method. When it is null or an object that
- doesn't have a property named by the input string, that string
- is returned. Otherwise, the value of the property corresponding
- to that string is returned.
-
-
- Below this a few more specialized, low-level options are
- listed. These are only useful in very specific situations, you
- might want to skip them the first time you read this manual.
-
-
- dragDrop : boolean
- Controls whether drag-and-drop is enabled. On by default.
-
- allowDropFileTypes : array<string>
- When set (default is null
) only files whose
- type is in the array can be dropped into the editor. The strings
- should be MIME types, and will be checked against
- the type
- of the File
object as reported by the browser.
-
- cursorBlinkRate : number
- Half-period in milliseconds used for cursor blinking. The default blink
- rate is 530ms. By setting this to zero, blinking can be disabled. A
- negative value hides the cursor entirely.
-
- cursorScrollMargin : number
- How much extra space to always keep above and below the
- cursor when approaching the top or bottom of the visible view in
- a scrollable document. Default is 0.
-
- cursorHeight : number
- Determines the height of the cursor. Default is 1, meaning
- it spans the whole height of the line. For some fonts (and by
- some tastes) a smaller height (for example 0.85
),
- which causes the cursor to not reach all the way to the bottom
- of the line, looks better
-
- singleCursorHeightPerLine : boolean
- If set to true
(the default), will keep the
- cursor height constant for an entire line (or wrapped part of a
- line). When false
, the cursor's height is based on
- the height of the adjacent reference character.
-
-
- Controls whether, when the context menu is opened with a
- click outside of the current selection, the cursor is moved to
- the point of the click. Defaults to true
.
-
- workTime , workDelay : number
- Highlighting is done by a pseudo background-thread that will
- work for workTime
milliseconds, and then use
- timeout to sleep for workDelay
milliseconds. The
- defaults are 200 and 300, you can change these options to make
- the highlighting more or less aggressive.
-
- pollInterval : number
- Indicates how quickly CodeMirror should poll its input
- textarea for changes (when focused). Most input is captured by
- events, but some things, like IME input on some browsers, don't
- generate events that allow CodeMirror to properly detect it.
- Thus, it polls. Default is 100 milliseconds.
-
- flattenSpans : boolean
- By default, CodeMirror will combine adjacent tokens into a
- single span if they have the same class. This will result in a
- simpler DOM tree, and thus perform better. With some kinds of
- styling (such as rounded corners), this will change the way the
- document looks. You can set this option to false to disable this
- behavior.
-
- addModeClass : boolean
- When enabled (off by default), an extra CSS class will be
- added to each token, indicating the
- (inner ) mode that produced it, prefixed
- with "cm-m-"
. For example, tokens from the XML mode
- will get the cm-m-xml
class.
-
- maxHighlightLength : number
- When highlighting long lines, in order to stay responsive,
- the editor will give up and simply style the rest of the line as
- plain text when it reaches a certain position. The default is
- 10 000. You can set this to Infinity
to turn off
- this behavior.
-
- viewportMargin : integer
- Specifies the amount of lines that are rendered above and
- below the part of the document that's currently scrolled into
- view. This affects the amount of updates needed when scrolling,
- and the amount of work that such an update does. You should
- usually leave it at its default, 10. Can be set
- to Infinity
to make sure the whole document is
- always rendered, and thus the browser's text search works on it.
- This will have bad effects on performance of big
- documents.
-
- spellcheck : boolean
- Specifies whether or not spellcheck will be enabled on the input.
-
- autocorrect : boolean
- Specifies whether or not autocorrect will be enabled on the input.
-
- autocapitalize : boolean
- Specifies whether or not autocapitalization will be enabled on the input.
-
-
-
-
- Events
-
- Various CodeMirror-related objects emit events, which allow
- client code to react to various situations. Handlers for such
- events can be registered with the on
- and off
methods on the objects
- that the event fires on. To fire your own events,
- use CodeMirror.signal(target, name, args...)
,
- where target
is a non-DOM-node object.
-
- An editor instance fires the following events.
- The instance
argument always refers to the editor
- itself.
-
-
- "change" (instance: CodeMirror, changeObj: object)
- Fires every time the content of the editor is changed.
- The changeObj
is a {from, to, text, removed,
- origin}
object containing information about the changes
- that occurred as second argument. from
- and to
are the positions (in the pre-change
- coordinate system) where the change started and ended (for
- example, it might be {ch:0, line:18}
if the
- position is at the beginning of line #19). text
is
- an array of strings representing the text that replaced the
- changed range (split by line). removed
is the text
- that used to be between from
and to
,
- which is overwritten by this change. This event is
- fired before the end of
- an operation , before the DOM updates
- happen.
-
- "changes" (instance: CodeMirror, changes: array<object>)
- Like the "change"
- event, but batched per operation ,
- passing an array containing all the changes that happened in the
- operation. This event is fired after the operation finished, and
- display changes it makes will trigger a new operation.
-
- "beforeChange" (instance: CodeMirror, changeObj: object)
- This event is fired before a change is applied, and its
- handler may choose to modify or cancel the change.
- The changeObj
object
- has from
, to
, and text
- properties, as with
- the "change"
event. It
- also has a cancel()
method, which can be called to
- cancel the change, and, if the change isn't
- coming from an undo or redo event, an update(from, to,
- text)
method, which may be used to modify the change.
- Undo or redo changes can't be modified, because they hold some
- metainformation for restoring old marked ranges that is only
- valid for that specific change. All three arguments
- to update
are optional, and can be left off to
- leave the existing value for that field
- intact. Note: you may not do anything from
- a "beforeChange"
handler that would cause changes
- to the document or its visualization. Doing so will, since this
- handler is called directly from the bowels of the CodeMirror
- implementation, probably cause the editor to become
- corrupted.
-
- "cursorActivity" (instance: CodeMirror)
- Will be fired when the cursor or selection moves, or any
- change is made to the editor content.
-
- "keyHandled" (instance: CodeMirror, name: string, event: Event)
- Fired after a key is handled through a
- key map. name
is the name of the handled key (for
- example "Ctrl-X"
or "'q'"
),
- and event
is the DOM keydown
- or keypress
event.
-
- "inputRead" (instance: CodeMirror, changeObj: object)
- Fired whenever new input is read from the hidden textarea
- (typed or pasted by the user).
-
- "electricInput" (instance: CodeMirror, line: integer)
- Fired if text input matched the
- mode's electric patterns,
- and this caused the line's indentation to change.
-
- "beforeSelectionChange" (instance: CodeMirror, obj: {ranges, origin, update})
- This event is fired before the selection is moved. Its
- handler may inspect the set of selection ranges, present as an
- array of {anchor, head}
objects in
- the ranges
property of the obj
- argument, and optionally change them by calling
- the update
method on this object, passing an array
- of ranges in the same format. The object also contains
- an origin
property holding the origin string passed
- to the selection-changing method, if any. Handlers for this
- event have the same restriction
- as "beforeChange"
- handlers — they should not do anything to directly update the
- state of the editor.
-
- "viewportChange" (instance: CodeMirror, from: number, to: number)
- Fires whenever the view port of
- the editor changes (due to scrolling, editing, or any other
- factor). The from
and to
arguments
- give the new start and end of the viewport.
-
- "swapDoc" (instance: CodeMirror, oldDoc: Doc)
- This is signalled when the editor's document is replaced
- using the swapDoc
- method.
-
- "gutterClick" (instance: CodeMirror, line: integer, gutter: string, clickEvent: Event)
- Fires when the editor gutter (the line-number area) is
- clicked. Will pass the editor instance as first argument, the
- (zero-based) number of the line that was clicked as second
- argument, the CSS class of the gutter that was clicked as third
- argument, and the raw mousedown
event object as
- fourth argument.
-
-
- Fires when the editor gutter (the line-number area)
- receives a contextmenu
event. Will pass the editor
- instance as first argument, the (zero-based) number of the line
- that was clicked as second argument, the CSS class of the
- gutter that was clicked as third argument, and the raw
- contextmenu
mouse event object as fourth argument.
- You can preventDefault
the event, to signal that
- CodeMirror should do no further handling.
-
- "focus" (instance: CodeMirror, event: Event)
- Fires whenever the editor is focused.
-
- "blur" (instance: CodeMirror, event: Event)
- Fires whenever the editor is unfocused.
-
- "scroll" (instance: CodeMirror)
- Fires when the editor is scrolled.
-
- "refresh" (instance: CodeMirror)
- Fires when the editor is refreshed
- or resized . Mostly useful to invalidate
- cached values that depend on the editor or character size.
-
- "optionChange" (instance: CodeMirror, option: string)
- Dispatched every time an option is changed with setOption
.
-
- "scrollCursorIntoView" (instance: CodeMirror, event: Event)
- Fires when the editor tries to scroll its cursor into view.
- Can be hooked into to take care of additional scrollable
- containers around the editor. When the event object has
- its preventDefault
method called, CodeMirror will
- not itself try to scroll the window.
-
- "update" (instance: CodeMirror)
- Will be fired whenever CodeMirror updates its DOM display.
-
- "renderLine" (instance: CodeMirror, line: LineHandle, element: Element)
- Fired whenever a line is (re-)rendered to the DOM. Fired
- right after the DOM element is built, before it is
- added to the document. The handler may mess with the style of
- the resulting element, or add event handlers, but
- should not try to change the state of the editor.
-
- "mousedown" ,
- "dblclick" , "touchstart" , "contextmenu" ,
- "keydown" , "keypress" ,
- "keyup" , "cut" , "copy" , "paste" ,
- "dragstart" , "dragenter" ,
- "dragover" , "dragleave" ,
- "drop"
- (instance: CodeMirror, event: Event)
- Fired when CodeMirror is handling a DOM event of this type.
- You can preventDefault
the event, or give it a
- truthy codemirrorIgnore
property, to signal that
- CodeMirror should do no further handling.
-
-
- Document objects (instances
- of CodeMirror.Doc
) emit the
- following events:
-
-
- "change" (doc: CodeMirror.Doc, changeObj: object)
- Fired whenever a change occurs to the
- document. changeObj
has a similar type as the
- object passed to the
- editor's "change"
- event.
-
- "beforeChange" (doc: CodeMirror.Doc, change: object)
- See the description of the
- same event on editor instances.
-
- "cursorActivity" (doc: CodeMirror.Doc)
- Fired whenever the cursor or selection in this document
- changes.
-
- "beforeSelectionChange" (doc: CodeMirror.Doc, selection: {head, anchor})
- Equivalent to
- the event by the same
- name as fired on editor instances.
-
-
- Line handles (as returned by, for
- example, getLineHandle
)
- support these events:
-
-
- "delete" ()
- Will be fired when the line object is deleted. A line object
- is associated with the start of the line. Mostly useful
- when you need to find out when your gutter
- markers on a given line are removed.
- "change" (line: LineHandle, changeObj: object)
- Fires when the line's text content is changed in any way
- (but the line is not deleted outright). The change
- object is similar to the one passed
- to change event on the editor
- object.
-
-
- Marked range handles (CodeMirror.TextMarker
), as returned
- by markText
- and setBookmark
, emit the
- following events:
-
-
- "beforeCursorEnter" ()
- Fired when the cursor enters the marked range. From this
- event handler, the editor state may be inspected
- but not modified, with the exception that the range on
- which the event fires may be cleared.
- "clear" (from: {line, ch}, to: {line, ch})
- Fired when the range is cleared, either through cursor
- movement in combination
- with clearOnEnter
- or through a call to its clear()
method. Will only
- be fired once per handle. Note that deleting the range through
- text editing does not fire this event, because an undo action
- might bring the range back into existence. from
- and to
give the part of the document that the range
- spanned when it was cleared.
- "hide" ()
- Fired when the last part of the marker is removed from the
- document by editing operations.
- "unhide" ()
- Fired when, after the marker was removed by editing, a undo
- operation brought the marker back.
-
-
- Line widgets (CodeMirror.LineWidget
), returned
- by addLineWidget
, fire
- these events:
-
-
- "redraw" ()
- Fired whenever the editor re-adds the widget to the DOM.
- This will happen once right after the widget is added (if it is
- scrolled into view), and then again whenever it is scrolled out
- of view and back in again, or when changes to the editor options
- or the line the widget is on require the widget to be
- redrawn.
-
-
-
-
- Key Maps
-
- Key maps are ways to associate keys and mouse buttons with
- functionality. A key map is an object mapping strings that
- identify the buttons to functions that implement their
- functionality.
-
- The CodeMirror distributions comes
- with Emacs , Vim ,
- and Sublime Text -style keymaps.
-
- Keys are identified either by name or by character.
- The CodeMirror.keyNames
object defines names for
- common keys and associates them with their key codes. Examples of
- names defined here are Enter
, F5
,
- and Q
. These can be prefixed
- with Shift-
, Cmd-
, Ctrl-
,
- and Alt-
to specify a modifier. So for
- example, Shift-Ctrl-Space
would be a valid key
- identifier.
-
- Common example: map the Tab key to insert spaces instead of a tab
- character.
-
-
-editor.setOption("extraKeys", {
- Tab: function(cm) {
- var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
- cm.replaceSelection(spaces);
- }
-});
-
- Alternatively, a character can be specified directly by
- surrounding it in single quotes, for example '$'
- or 'q'
. Due to limitations in the way browsers fire
- key events, these may not be prefixed with modifiers.
-
- To bind mouse buttons, use the names `LeftClick`,
- `MiddleClick`, and `RightClick`. These can also be prefixed with
- modifiers, and in addition, the word `Double` or `Triple` can be
- put before `Click` (as in `LeftDoubleClick`) to bind a double- or
- triple-click. The function for such a binding is passed the
- position that was clicked as second argument.
-
- Multi-stroke key bindings can be specified
- by separating the key names by spaces in the property name, for
- example Ctrl-X Ctrl-V
. When a map contains
- multi-stoke bindings or keys with modifiers that are not specified
- in the default order (Shift-Cmd-Ctrl-Alt
), you must
- call CodeMirror.normalizeKeyMap
on it before it can
- be used. This function takes a keymap and modifies it to normalize
- modifier order and properly recognize multi-stroke bindings. It
- will return the keymap itself.
-
- The CodeMirror.keyMap
object associates key maps
- with names. User code and key map definitions can assign extra
- properties to this object. Anywhere where a key map is expected, a
- string can be given, which will be looked up in this object. It
- also contains the "default"
key map holding the
- default bindings.
-
- The values of properties in key maps can be either functions of
- a single argument (the CodeMirror instance), strings, or
- false
. Strings refer
- to commands , which are described below. If
- the property is set to false
, CodeMirror leaves
- handling of the key up to the browser. A key handler function may
- return CodeMirror.Pass
to indicate that it has
- decided not to handle the key, and other handlers (or the default
- behavior) should be given a turn.
-
- Keys mapped to command names that start with the
- characters "go"
or to functions that have a
- truthy motion
property (which should be used for
- cursor-movement actions) will be fired even when an
- extra Shift
modifier is present (i.e. "Up":
- "goLineUp"
matches both up and shift-up). This is used to
- easily implement shift-selection.
-
- Key maps can defer to each other by defining
- a fallthrough
property. This indicates that when a
- key is not found in the map itself, one or more other maps should
- be searched. It can hold either a single key map or an array of
- key maps.
-
- When a key map needs to set something up when it becomes
- active, or tear something down when deactivated, it can
- contain attach
and/or detach
properties,
- which should hold functions that take the editor instance and the
- next or previous keymap. Note that this only works for the
- top-level keymap , not for fallthrough
- maps or maps added
- with extraKeys
- or addKeyMap
.
-
-
-
- Commands
-
- Commands are parameter-less actions that can be performed on an
- editor. Their main use is for key bindings. Commands are defined by
- adding properties to the CodeMirror.commands
object.
- A number of common commands are defined by the library itself,
- most of them used by the default key bindings. The value of a
- command property must be a function of one argument (an editor
- instance).
-
- Some of the commands below are referenced in the default
- key map, but not defined by the core library. These are intended to
- be defined by user code or addons.
-
- Commands can also be run with
- the execCommand
- method.
-
-
- selectAll
Ctrl-A (PC), Cmd-A (Mac)
- Select the whole content of the editor.
-
- singleSelection
Esc
- When multiple selections are present, this deselects all but
- the primary selection.
-
- killLine
Ctrl-K (Mac)
- Emacs-style line killing. Deletes the part of the line after
- the cursor. If that consists only of whitespace, the newline at
- the end of the line is also deleted.
-
- deleteLine
Ctrl-D (PC), Cmd-D (Mac)
- Deletes the whole line under the cursor, including newline at the end.
-
- delLineLeft
- Delete the part of the line before the cursor.
-
- delWrappedLineLeft
Cmd-Backspace (Mac)
- Delete the part of the line from the left side of the visual line the cursor is on to the cursor.
-
- delWrappedLineRight
Cmd-Delete (Mac)
- Delete the part of the line from the cursor to the right side of the visual line the cursor is on.
-
- undo
Ctrl-Z (PC), Cmd-Z (Mac)
- Undo the last change. Note that, because browsers still
- don't make it possible for scripts to react to or customize the
- context menu, selecting undo (or redo) from the context menu in
- a CodeMirror instance does not work.
-
- redo
Ctrl-Y (PC), Shift-Cmd-Z (Mac), Cmd-Y (Mac)
- Redo the last undone change.
-
- undoSelection
Ctrl-U (PC), Cmd-U (Mac)
- Undo the last change to the selection, or if there are no
- selection-only changes at the top of the history, undo the last
- change.
-
- redoSelection
Alt-U (PC), Shift-Cmd-U (Mac)
- Redo the last change to the selection, or the last text change if
- no selection changes remain.
-
- goDocStart
Ctrl-Home (PC), Cmd-Up (Mac), Cmd-Home (Mac)
- Move the cursor to the start of the document.
-
- goDocEnd
Ctrl-End (PC), Cmd-End (Mac), Cmd-Down (Mac)
- Move the cursor to the end of the document.
-
- goLineStart
Alt-Left (PC), Ctrl-A (Mac)
- Move the cursor to the start of the line.
-
- goLineStartSmart
Home
- Move to the start of the text on the line, or if we are
- already there, to the actual start of the line (including
- whitespace).
-
- goLineEnd
Alt-Right (PC), Ctrl-E (Mac)
- Move the cursor to the end of the line.
-
- goLineRight
Cmd-Right (Mac)
- Move the cursor to the right side of the visual line it is on.
-
- goLineLeft
Cmd-Left (Mac)
- Move the cursor to the left side of the visual line it is on. If
- this line is wrapped, that may not be the start of the line.
-
- goLineLeftSmart
- Move the cursor to the left side of the visual line it is
- on. If that takes it to the start of the line, behave
- like goLineStartSmart
.
-
- goLineUp
Up, Ctrl-P (Mac)
- Move the cursor up one line.
-
- goLineDown
Down, Ctrl-N (Mac)
- Move down one line.
-
- goPageUp
PageUp, Shift-Ctrl-V (Mac)
- Move the cursor up one screen, and scroll up by the same distance.
-
- goPageDown
PageDown, Ctrl-V (Mac)
- Move the cursor down one screen, and scroll down by the same distance.
-
- goCharLeft
Left, Ctrl-B (Mac)
- Move the cursor one character left, going to the previous line
- when hitting the start of line.
-
- goCharRight
Right, Ctrl-F (Mac)
- Move the cursor one character right, going to the next line
- when hitting the end of line.
-
- goColumnLeft
- Move the cursor one character left, but don't cross line boundaries.
-
- goColumnRight
- Move the cursor one character right, don't cross line boundaries.
-
- goWordLeft
Alt-B (Mac)
- Move the cursor to the start of the previous word.
-
- goWordRight
Alt-F (Mac)
- Move the cursor to the end of the next word.
-
- goGroupLeft
Ctrl-Left (PC), Alt-Left (Mac)
- Move to the left of the group before the cursor. A group is
- a stretch of word characters, a stretch of punctuation
- characters, a newline, or a stretch of more than one
- whitespace character.
-
- goGroupRight
Ctrl-Right (PC), Alt-Right (Mac)
- Move to the right of the group after the cursor
- (see above ).
-
- delCharBefore
Shift-Backspace, Ctrl-H (Mac)
- Delete the character before the cursor.
-
- delCharAfter
Delete, Ctrl-D (Mac)
- Delete the character after the cursor.
-
- delWordBefore
Alt-Backspace (Mac)
- Delete up to the start of the word before the cursor.
-
- delWordAfter
Alt-D (Mac)
- Delete up to the end of the word after the cursor.
-
- delGroupBefore
Ctrl-Backspace (PC), Alt-Backspace (Mac)
- Delete to the left of the group before the cursor.
-
- delGroupAfter
Ctrl-Delete (PC), Ctrl-Alt-Backspace (Mac), Alt-Delete (Mac)
- Delete to the start of the group after the cursor.
-
- indentAuto
Shift-Tab
- Auto-indent the current line or selection.
-
- indentMore
Ctrl-] (PC), Cmd-] (Mac)
- Indent the current line or selection by one indent unit .
-
- indentLess
Ctrl-[ (PC), Cmd-[ (Mac)
- Dedent the current line or selection by one indent unit .
-
- insertTab
- Insert a tab character at the cursor.
-
- insertSoftTab
- Insert the amount of spaces that match the width a tab at
- the cursor position would have.
-
- defaultTab
Tab
- If something is selected, indent it by
- one indent unit . If nothing is
- selected, insert a tab character.
-
- transposeChars
Ctrl-T (Mac)
- Swap the characters before and after the cursor.
-
- newlineAndIndent
Enter
- Insert a newline and auto-indent the new line.
-
- toggleOverwrite
Insert
- Flip the overwrite flag.
-
- save
Ctrl-S (PC), Cmd-S (Mac)
- Not defined by the core library, only referred to in
- key maps. Intended to provide an easy way for user code to define
- a save command.
-
- find
Ctrl-F (PC), Cmd-F (Mac)
- findNext
Ctrl-G (PC), Cmd-G (Mac)
- findPrev
Shift-Ctrl-G (PC), Shift-Cmd-G (Mac)
- replace
Shift-Ctrl-F (PC), Cmd-Alt-F (Mac)
- replaceAll
Shift-Ctrl-R (PC), Shift-Cmd-Alt-F (Mac)
- Not defined by the core library, but defined in
- the search addon (or custom client
- addons).
-
-
-
-
-
-
- Customized Styling
-
- Up to a certain extent, CodeMirror's look can be changed by
- modifying style sheet files. The style sheets supplied by modes
- simply provide the colors for that mode, and can be adapted in a
- very straightforward way. To style the editor itself, it is
- possible to alter or override the styles defined
- in codemirror.css
.
-
- Some care must be taken there, since a lot of the rules in this
- file are necessary to have CodeMirror function properly. Adjusting
- colors should be safe, of course, and with some care a lot of
- other things can be changed as well. The CSS classes defined in
- this file serve the following roles:
-
-
- CodeMirror
- The outer element of the editor. This should be used for the
- editor width, height, borders and positioning. Can also be used
- to set styles that should hold for everything inside the editor
- (such as font and font size), or to set a background. Setting
- this class' height
style to auto
will
- make the editor resize to fit its
- content (it is recommended to also set
- the viewportMargin
- option to Infinity
when doing this.
-
- CodeMirror-focused
- Whenever the editor is focused, the top element gets this
- class. This is used to hide the cursor and give the selection a
- different color when the editor is not focused.
-
- CodeMirror-gutters
- This is the backdrop for all gutters. Use it to set the
- default gutter background color, and optionally add a border on
- the right of the gutters.
-
- CodeMirror-linenumbers
- Use this for giving a background or width to the line number
- gutter.
-
- CodeMirror-linenumber
- Used to style the actual individual line numbers. These
- won't be children of the CodeMirror-linenumbers
- (plural) element, but rather will be absolutely positioned to
- overlay it. Use this to set alignment and text properties for
- the line numbers.
-
- CodeMirror-lines
- The visible lines. This is where you specify vertical
- padding for the editor content.
-
- CodeMirror-cursor
- The cursor is a block element that is absolutely positioned.
- You can make it look whichever way you want.
-
- CodeMirror-selected
- The selection is represented by span
elements
- with this class.
-
- CodeMirror-matchingbracket
,
- CodeMirror-nonmatchingbracket
- These are used to style matched (or unmatched) brackets.
-
-
- If your page's style sheets do funky things to
- all div
or pre
elements (you probably
- shouldn't do that), you'll have to define rules to cancel these
- effects out again for elements under the CodeMirror
- class.
-
- Themes are also simply CSS files, which define colors for
- various syntactic elements. See the files in
- the theme
directory.
-
-
-
- Programming API
-
- A lot of CodeMirror features are only available through its
- API. Thus, you need to write code (or
- use addons ) if you want to expose them to
- your users.
-
- Whenever points in the document are represented, the API uses
- objects with line
and ch
properties.
- Both are zero-based. CodeMirror makes sure to 'clip' any positions
- passed by client code so that they fit inside the document, so you
- shouldn't worry too much about sanitizing your coordinates. If you
- give ch
a value of null
, or don't
- specify it, it will be replaced with the length of the specified
- line. Such positions may also have a sticky
property
- holding "before"
or "after"
, whether the
- position is associated with the character before or after it. This
- influences, for example, where the cursor is drawn on a
- line-break or bidi-direction boundary.
-
- Methods prefixed with doc.
can, unless otherwise
- specified, be called both on CodeMirror
(editor)
- instances and CodeMirror.Doc
instances. Methods
- prefixed with cm.
are only available
- on CodeMirror
instances.
-
- Constructor
-
- Constructing an editor instance is done with
- the CodeMirror (place: Element|fn(Element),
- ?option: object)
constructor. If the place
- argument is a DOM element, the editor will be appended to it. If
- it is a function, it will be called, and is expected to place the
- editor into the document. options
may be an element
- mapping option names to values. The options
- that it doesn't explicitly specify (or all options, if it is not
- passed) will be taken
- from CodeMirror.defaults
.
-
- Note that the options object passed to the constructor will be
- mutated when the instance's options
- are changed , so you shouldn't share such
- objects between instances.
-
- See CodeMirror.fromTextArea
- for another way to construct an editor instance.
-
- Content manipulation methods
-
-
- doc.getValue (?separator: string) → string
- Get the current editor content. You can pass it an optional
- argument to specify the string to be used to separate lines
- (defaults to "\n"
).
- doc.setValue (content: string)
- Set the editor content.
-
- doc.getRange (from: {line, ch}, to: {line, ch}, ?separator: string) → string
- Get the text between the given points in the editor, which
- should be {line, ch}
objects. An optional third
- argument can be given to indicate the line separator string to
- use (defaults to "\n"
).
- doc.replaceRange (replacement: string, from: {line, ch}, to: {line, ch}, ?origin: string)
- Replace the part of the document between from
- and to
with the given string. from
- and to
must be {line, ch}
- objects. to
can be left off to simply insert the
- string at position from
. When origin
- is given, it will be passed on
- to "change"
events , and
- its first letter will be used to determine whether this change
- can be merged with previous history events, in the way described
- for selection origins .
-
- doc.getLine (n: integer) → string
- Get the content of line n
.
-
- doc.lineCount () → integer
- Get the number of lines in the editor.
- doc.firstLine () → integer
- Get the number of first line in the editor. This will
- usually be zero but for linked sub-views ,
- or documents instantiated with a non-zero
- first line, it might return other values.
- doc.lastLine () → integer
- Get the number of last line in the editor. This will
- usually be doc.lineCount() - 1
,
- but for linked sub-views ,
- it might return other values.
-
- doc.getLineHandle (num: integer) → LineHandle
- Fetches the line handle for the given line number.
- doc.getLineNumber (handle: LineHandle) → integer
- Given a line handle, returns the current position of that
- line (or null
when it is no longer in the
- document).
- doc.eachLine (f: (line: LineHandle))
- doc.eachLine (start: integer, end: integer, f: (line: LineHandle))
- Iterate over the whole document, or if start
- and end
line numbers are given, the range
- from start
up to (not including) end
,
- and call f
for each line, passing the line handle.
- eachLine
stops iterating if f
returns
- truthy value.
- This is a faster way to visit a range of line handlers than
- calling getLineHandle
- for each of them. Note that line handles have
- a text
property containing the line's content (as a
- string).
-
- doc.markClean ()
- Set the editor content as 'clean', a flag that it will
- retain until it is edited, and which will be set again when such
- an edit is undone again. Useful to track whether the content
- needs to be saved. This function is deprecated in favor
- of changeGeneration
,
- which allows multiple subsystems to track different notions of
- cleanness without interfering.
- doc.changeGeneration (?closeEvent: boolean) → integer
- Returns a number that can later be passed
- to isClean
to test whether
- any edits were made (and not undone) in the meantime.
- If closeEvent
is true, the current history event
- will be ‘closed’, meaning it can't be combined with further
- changes (rapid typing or deleting events are typically
- combined).
- doc.isClean (?generation: integer) → boolean
- Returns whether the document is currently clean — not
- modified since initialization or the last call
- to markClean
if no
- argument is passed, or since the matching call
- to changeGeneration
- if a generation value is given.
-
-
- Cursor and selection methods
-
-
- doc.getSelection (?lineSep: string) → string
- Get the currently selected code. Optionally pass a line
- separator to put between the lines in the output. When multiple
- selections are present, they are concatenated with instances
- of lineSep
in between.
- doc.getSelections (?lineSep: string) → array<string>
- Returns an array containing a string for each selection,
- representing the content of the selections.
-
- doc.replaceSelection (replacement: string, ?select: string)
- Replace the selection(s) with the given string. By default,
- the new selection ends up after the inserted text. The
- optional select
argument can be used to change
- this—passing "around"
will cause the new text to be
- selected, passing "start"
will collapse the
- selection to the start of the inserted text.
- doc.replaceSelections (replacements: array<string>, ?select: string)
- The length of the given array should be the same as the
- number of active selections. Replaces the content of the
- selections with the strings in the array.
- The select
argument works the same as
- in replaceSelection
.
-
- doc.getCursor (?start: string) → {line, ch}
- Retrieve one end of the primary
- selection. start
is an optional string indicating
- which end of the selection to return. It may
- be "from"
, "to"
, "head"
- (the side of the selection that moves when you press
- shift+arrow), or "anchor"
(the fixed side of the
- selection). Omitting the argument is the same as
- passing "head"
. A {line, ch}
object
- will be returned.
- doc.listSelections () → array<{anchor, head}>
- Retrieves a list of all current selections. These will
- always be sorted, and never overlap (overlapping selections are
- merged). Each object in the array contains anchor
- and head
properties referring to {line,
- ch}
objects.
-
- doc.somethingSelected () → boolean
- Return true if any text is selected.
- doc.setCursor (pos: {line, ch}|number, ?ch: number, ?options: object)
- Set the cursor position. You can either pass a
- single {line, ch}
object, or the line and the
- character as two separate parameters. Will replace all
- selections with a single, empty selection at the given position.
- The supported options are the same as for setSelection
.
-
- doc.setSelection (anchor: {line, ch}, ?head: {line, ch}, ?options: object)
- Set a single selection range. anchor
- and head
should be {line, ch}
- objects. head
defaults to anchor
when
- not given. These options are supported:
-
- scroll : boolean
- Determines whether the selection head should be scrolled
- into view. Defaults to true.
- origin : string
- Determines whether the selection history event may be
- merged with the previous one. When an origin starts with the
- character +
, and the last recorded selection had
- the same origin and was similar (close
- in time , both
- collapsed or both non-collapsed), the new one will replace the
- old one. When it starts with *
, it will always
- replace the previous event (if that had the same origin).
- Built-in motion uses the "+move"
origin. User input uses the "+input"
origin.
- bias : number
- Determine the direction into which the selection endpoints
- should be adjusted when they fall inside
- an atomic range. Can be either -1
- (backward) or 1 (forward). When not given, the bias will be
- based on the relative position of the old selection—the editor
- will try to move further away from that, to prevent getting
- stuck.
-
-
- doc.setSelections (ranges: array<{anchor, ?head}>, ?primary: integer, ?options: object)
- Sets a new set of selections. There must be at least one
- selection in the given array. When primary
is a
- number, it determines which selection is the primary one. When
- it is not given, the primary index is taken from the previous
- selection, or set to the last range if the previous selection
- had less ranges than the new one. Supports the same options
- as setSelection
.
- head
defaults to anchor
when not given.
- doc.addSelection (anchor: {line, ch}, ?head: {line, ch})
- Adds a new selection to the existing set of selections, and
- makes it the primary selection.
-
- doc.extendSelection (from: {line, ch}, ?to: {line, ch}, ?options: object)
- Similar
- to setSelection
, but
- will, if shift is held or
- the extending flag is set, move the
- head of the selection while leaving the anchor at its current
- place. to
is optional, and can be passed to ensure
- a region (for example a word or paragraph) will end up selected
- (in addition to whatever lies between that region and the
- current anchor). When multiple selections are present, all but
- the primary selection will be dropped by this method.
- Supports the same options as setSelection
.
- doc.extendSelections (heads: array<{line, ch}>, ?options: object)
- An equivalent
- of extendSelection
- that acts on all selections at once.
- doc.extendSelectionsBy (f: function(range: {anchor, head}) → {line, ch}), ?options: object)
- Applies the given function to all existing selections, and
- calls extendSelections
- on the result.
- doc.setExtending (value: boolean)
- Sets or clears the 'extending' flag, which acts similar to
- the shift key, in that it will cause cursor movement and calls
- to extendSelection
- to leave the selection anchor in place.
- doc.getExtending () → boolean
- Get the value of the 'extending' flag.
-
- cm.hasFocus () → boolean
- Tells you whether the editor currently has focus.
-
- cm.findPosH (start: {line, ch}, amount: integer, unit: string, visually: boolean) → {line, ch, ?hitSide: boolean}
- Used to find the target position for horizontal cursor
- motion. start
is a {line, ch}
- object, amount
an integer (may be negative),
- and unit
one of the
- string "char"
, "column"
,
- or "word"
. Will return a position that is produced
- by moving amount
times the distance specified
- by unit
. When visually
is true, motion
- in right-to-left text will be visual rather than logical. When
- the motion was clipped by hitting the end or start of the
- document, the returned value will have a hitSide
- property set to true.
- cm.findPosV (start: {line, ch}, amount: integer, unit: string) → {line, ch, ?hitSide: boolean}
- Similar to findPosH
,
- but used for vertical motion. unit
may
- be "line"
or "page"
. The other
- arguments and the returned value have the same interpretation as
- they have in findPosH
.
-
- cm.findWordAt (pos: {line, ch}) → {anchor: {line, ch}, head: {line, ch}}
- Returns the start and end of the 'word' (the stretch of
- letters, whitespace, or punctuation) at the given position.
-
-
- Configuration methods
-
-
- cm.setOption (option: string, value: any)
- Change the configuration of the editor. option
- should the name of an option ,
- and value
should be a valid value for that
- option.
- cm.getOption (option: string) → any
- Retrieves the current value of the given option for this
- editor instance.
-
- cm.addKeyMap (map: object, bottom: boolean)
- Attach an additional key map to the
- editor. This is mostly useful for addons that need to register
- some key handlers without trampling on
- the extraKeys
- option. Maps added in this way have a higher precedence than
- the extraKeys
- and keyMap
options,
- and between them, the maps added earlier have a lower precedence
- than those added later, unless the bottom
argument
- was passed, in which case they end up below other key maps added
- with this method.
- cm.removeKeyMap (map: object)
- Disable a keymap added
- with addKeyMap
. Either
- pass in the key map object itself, or a string, which will be
- compared against the name
property of the active
- key maps.
-
- cm.addOverlay (mode: string|object, ?options: object)
- Enable a highlighting overlay. This is a stateless mini-mode
- that can be used to add extra highlighting. For example,
- the search addon uses it to
- highlight the term that's currently being
- searched. mode
can be a mode
- spec or a mode object (an object with
- a token
method).
- The options
parameter is optional. If given, it
- should be an object, optionally containing the following options:
-
- opaque : bool
- Defaults to off, but can be given to allow the overlay
- styling, when not null
, to override the styling of
- the base mode entirely, instead of the two being applied
- together.
- priority : number
- Determines the ordering in which the overlays are
- applied. Those with high priority are applied after those
- with lower priority, and able to override the opaqueness of
- the ones that come before. Defaults to 0.
-
-
-
- cm.removeOverlay (mode: string|object)
- Pass this the exact value passed for the mode
- parameter to addOverlay
,
- or a string that corresponds to the name
property of
- that value, to remove an overlay again.
-
- cm.on (type: string, func: (...args))
- Register an event handler for the given event type (a
- string) on the editor instance. There is also
- a CodeMirror.on(object, type, func)
version
- that allows registering of events on any object.
- cm.off (type: string, func: (...args))
- Remove an event handler on the editor instance. An
- equivalent CodeMirror.off(object, type,
- func)
also exists.
-
-
- Document management methods
-
- Each editor is associated with an instance
- of CodeMirror.Doc
, its document. A document
- represents the editor content, plus a selection, an undo history,
- and a mode . A document can only be
- associated with a single editor at a time. You can create new
- documents by calling the CodeMirror.Doc(text: string, mode:
- Object, firstLineNumber: ?number, lineSeparator: ?string)
- constructor. The last three arguments are optional and can be used
- to set a mode for the document, make it start at a line number
- other than 0, and set a specific line separator respectively.
-
-
- cm.getDoc () → Doc
- Retrieve the currently active document from an editor.
- doc.getEditor () → CodeMirror
- Retrieve the editor associated with a document. May
- return null
.
-
- cm.swapDoc (doc: CodeMirror.Doc) → Doc
- Attach a new document to the editor. Returns the old
- document, which is now no longer associated with an editor.
-
- doc.copy (copyHistory: boolean) → Doc
- Create an identical copy of the given doc.
- When copyHistory
is true, the history will also be
- copied. Can not be called directly on an editor.
-
- doc.linkedDoc (options: object) → Doc
- Create a new document that's linked to the target document.
- Linked documents will stay in sync (changes to one are also
- applied to the other) until unlinked .
- These are the options that are supported:
-
- sharedHist : boolean
- When turned on, the linked copy will share an undo
- history with the original. Thus, something done in one of
- the two can be undone in the other, and vice versa.
- from : integer
- to : integer
- Can be given to make the new document a subview of the
- original. Subviews only show a given range of lines. Note
- that line coordinates inside the subview will be consistent
- with those of the parent, so that for example a subview
- starting at line 10 will refer to its first line as line 10,
- not 0.
- mode : string|object
- By default, the new document inherits the mode of the
- parent. This option can be set to
- a mode spec to give it a
- different mode.
-
- doc.unlinkDoc (doc: CodeMirror.Doc)
- Break the link between two documents. After calling this,
- changes will no longer propagate between the documents, and, if
- they had a shared history, the history will become
- separate.
- doc.iterLinkedDocs (function: (doc: CodeMirror.Doc, sharedHist: boolean))
- Will call the given function for all documents linked to the
- target document. It will be passed two arguments, the linked document
- and a boolean indicating whether that document shares history
- with the target.
-
-
- History-related methods
-
-
- doc.undo ()
- Undo one edit (if any undo events are stored).
- doc.redo ()
- Redo one undone edit.
-
- doc.undoSelection ()
- Undo one edit or selection change.
- doc.redoSelection ()
- Redo one undone edit or selection change.
-
- doc.historySize () → {undo: integer, redo: integer}
- Returns an object with {undo, redo}
properties,
- both of which hold integers, indicating the amount of stored
- undo and redo operations.
- doc.clearHistory ()
- Clears the editor's undo history.
- doc.getHistory () → object
- Get a (JSON-serializable) representation of the undo history.
- doc.setHistory (history: object)
- Replace the editor's undo history with the one provided,
- which must be a value as returned
- by getHistory
. Note that
- this will have entirely undefined results if the editor content
- isn't also the same as it was when getHistory
was
- called.
-
-
- Text-marking methods
-
-
- doc.markText (from: {line, ch}, to: {line, ch}, ?options: object) → TextMarker
- Can be used to mark a range of text with a specific CSS
- class name. from
and to
should
- be {line, ch}
objects. The options
- parameter is optional. When given, it should be an object that
- may contain the following configuration options:
-
- className : string
- Assigns a CSS class to the marked stretch of text.
- inclusiveLeft : boolean
- Determines whether
- text inserted on the left of the marker will end up inside
- or outside of it.
- inclusiveRight : boolean
- Like inclusiveLeft
,
- but for the right side.
- selectLeft : boolean
- For atomic ranges, determines whether the cursor is allowed
- to be placed directly to the left of the range. Has no effect on
- non-atomic ranges.
- selectRight : boolean
- Like selectLeft
,
- but for the right side.
- atomic : boolean
- Atomic ranges act as a single unit when cursor movement is
- concerned—i.e. it is impossible to place the cursor inside of
- them. You can control whether the cursor is allowed to be placed
- directly before or after them using selectLeft
- or selectRight
. If selectLeft
- (or right) is not provided, then inclusiveLeft
(or
- right) will control this behavior.
- collapsed : boolean
- Collapsed ranges do not show up in the display. Setting a
- range to be collapsed will automatically make it atomic.
- clearOnEnter : boolean
- When enabled, will cause the mark to clear itself whenever
- the cursor enters its range. This is mostly useful for
- text-replacement widgets that need to 'snap open' when the
- user tries to edit them. The
- "clear"
event
- fired on the range handle can be used to be notified when this
- happens.
- clearWhenEmpty : boolean
- Determines whether the mark is automatically cleared when
- it becomes empty. Default is true.
- replacedWith : Element
- Use a given node to display this range. Implies both
- collapsed and atomic. The given DOM node must be an
- inline element (as opposed to a block element).
- handleMouseEvents : boolean
- When replacedWith
is given, this determines
- whether the editor will capture mouse and drag events
- occurring in this widget. Default is false—the events will be
- left alone for the default browser handler, or specific
- handlers on the widget, to capture.
- readOnly : boolean
- A read-only span can, as long as it is not cleared, not be
- modified except by
- calling setValue
to reset
- the whole document. Note: adding a read-only span
- currently clears the undo history of the editor, because
- existing undo events being partially nullified by read-only
- spans would corrupt the history (in the current
- implementation).
- addToHistory : boolean
- When set to true (default is false), adding this marker
- will create an event in the undo history that can be
- individually undone (clearing the marker).
- startStyle : string
Can be used to specify
- an extra CSS class to be applied to the leftmost span that
- is part of the marker.
- endStyle : string
Equivalent
- to startStyle
, but for the rightmost span.
- css : string
- A string of CSS to be applied to the covered text. For example "color: #fe3"
.
- attributes : object
- When given, add the attributes in the given object to the
- elements created for the marked text. Adding class
or
- style
attributes this way is not supported.
- shared : boolean
When the
- target document is linked to other
- documents, you can set shared
to true to make the
- marker appear in all documents. By default, a marker appears
- only in its target document.
-
- The method will return an object that represents the marker
- (with constructor CodeMirror.TextMarker
), which
- exposes three methods:
- clear ()
, to remove the mark,
- find ()
, which returns
- a {from, to}
object (both holding document
- positions), indicating the current position of the marked range,
- or undefined
if the marker is no longer in the
- document, and finally changed ()
,
- which you can call if you've done something that might change
- the size of the marker (for example changing the content of
- a replacedWith
- node), and want to cheaply update the display.
-
- doc.setBookmark (pos: {line, ch}, ?options: object) → TextMarker
- Inserts a bookmark, a handle that follows the text around it
- as it is being edited, at the given position. A bookmark has two
- methods find()
and clear()
. The first
- returns the current position of the bookmark, if it is still in
- the document, and the second explicitly removes the bookmark.
- The options argument is optional. If given, the following
- properties are recognized:
-
- widget : Element
Can be used to display a DOM
- node at the current location of the bookmark (analogous to
- the replacedWith
- option to markText
).
- insertLeft : boolean
By default, text typed
- when the cursor is on top of the bookmark will end up to the
- right of the bookmark. Set this option to true to make it go
- to the left instead.
- shared : boolean
See
- the corresponding option
- to markText
.
- handleMouseEvents : boolean
- As with markText
,
- this determines whether mouse events on the widget inserted
- for this bookmark are handled by CodeMirror. The default is
- false.
-
-
- doc.findMarks (from: {line, ch}, to: {line, ch}) → array<TextMarker>
- Returns an array of all the bookmarks and marked ranges
- found between the given positions (non-inclusive).
- doc.findMarksAt (pos: {line, ch}) → array<TextMarker>
- Returns an array of all the bookmarks and marked ranges
- present at the given position.
- doc.getAllMarks () → array<TextMarker>
- Returns an array containing all marked ranges in the document.
-
-
- Widget, gutter, and decoration methods
-
-
- doc.setGutterMarker (line: integer|LineHandle, gutterID: string, value: Element) → LineHandle
- Sets the gutter marker for the given gutter (identified by
- its CSS class, see
- the gutters
option)
- to the given value. Value can be either null
, to
- clear the marker, or a DOM element, to set it. The DOM element
- will be shown in the specified gutter next to the specified
- line.
-
- doc.clearGutter (gutterID: string)
- Remove all gutter markers in
- the gutter with the given ID.
-
- doc.addLineClass (line: integer|LineHandle, where: string, class: string) → LineHandle
- Set a CSS class name for the given line. line
- can be a number or a line handle. where
determines
- to which element this class should be applied, can be one
- of "text"
(the text element, which lies in front of
- the selection), "background"
(a background element
- that will be behind the selection), "gutter"
(the
- line's gutter space), or "wrap"
(the wrapper node
- that wraps all of the line's elements, including gutter
- elements). class
should be the name of the class to
- apply.
-
- doc.removeLineClass (line: integer|LineHandle, where: string, class: string) → LineHandle
- Remove a CSS class from a line. line
can be a
- line handle or number. where
should be one
- of "text"
, "background"
,
- or "wrap"
- (see addLineClass
). class
- can be left off to remove all classes for the specified node, or
- be a string to remove only a specific class.
-
- doc.lineInfo (line: integer|LineHandle) → object
- Returns the line number, text content, and marker status of
- the given line, which can be either a number or a line handle.
- The returned object has the structure {line, handle, text,
- gutterMarkers, textClass, bgClass, wrapClass, widgets}
,
- where gutterMarkers
is an object mapping gutter IDs
- to marker elements, and widgets
is an array
- of line widgets attached to this
- line, and the various class properties refer to classes added
- with addLineClass
.
-
- cm.addWidget (pos: {line, ch}, node: Element, scrollIntoView: boolean)
- Puts node
, which should be an absolutely
- positioned DOM node, into the editor, positioned right below the
- given {line, ch}
position.
- When scrollIntoView
is true, the editor will ensure
- that the entire node is visible (if possible). To remove the
- widget again, simply use DOM methods (move it somewhere else, or
- call removeChild
on its parent).
-
- doc.addLineWidget (line: integer|LineHandle, node: Element, ?options: object) → LineWidget
- Adds a line widget, an element shown below a line, spanning
- the whole of the editor's width, and moving the lines below it
- downwards. line
should be either an integer or a
- line handle, and node
should be a DOM node, which
- will be displayed below the given line. options
,
- when given, should be an object that configures the behavior of
- the widget. The following options are supported (all default to
- false):
-
- coverGutter : boolean
- Whether the widget should cover the gutter.
- noHScroll : boolean
- Whether the widget should stay fixed in the face of
- horizontal scrolling.
- above : boolean
- Causes the widget to be placed above instead of below
- the text of the line.
- handleMouseEvents : boolean
- Determines whether the editor will capture mouse and
- drag events occurring in this widget. Default is false—the
- events will be left alone for the default browser handler,
- or specific handlers on the widget, to capture.
- insertAt : integer
- By default, the widget is added below other widgets for
- the line. This option can be used to place it at a different
- position (zero for the top, N to put it after the Nth other
- widget). Note that this only has effect once, when the
- widget is created.
- className : string
- Add an extra CSS class name to the wrapper element
- created for the widget.
-
- Note that the widget node will become a descendant of nodes with
- CodeMirror-specific CSS classes, and those classes might in some
- cases affect it. This method returns an object that represents
- the widget placement. It'll have a line
property
- pointing at the line handle that it is associated with, and the following methods:
-
- clear ()
Removes the widget.
- changed ()
Call
- this if you made some change to the widget's DOM node that
- might affect its height. It'll force CodeMirror to update
- the height of the line that contains the widget.
-
-
-
-
- Sizing, scrolling and positioning methods
-
-
- cm.setSize (width: number|string, height: number|string)
- Programmatically set the size of the editor (overriding the
- applicable CSS
- rules ). width
and height
- can be either numbers (interpreted as pixels) or CSS units
- ("100%"
, for example). You can
- pass null
for either of them to indicate that that
- dimension should not be changed.
-
- cm.scrollTo (x: number, y: number)
- Scroll the editor to a given (pixel) position. Both
- arguments may be left as null
- or undefined
to have no effect.
- cm.getScrollInfo () → {left, top, width, height, clientWidth, clientHeight}
- Get an {left, top, width, height, clientWidth,
- clientHeight}
object that represents the current scroll
- position, the size of the scrollable area, and the size of the
- visible area (minus scrollbars).
- cm.scrollIntoView (what: {line, ch}|{left, top, right, bottom}|{from, to}|null, ?margin: number)
- Scrolls the given position into view. what
may
- be null
to scroll the cursor into view,
- a {line, ch}
position to scroll a character into
- view, a {left, top, right, bottom}
pixel range (in
- editor-local coordinates), or a range {from, to}
- containing either two character positions or two pixel squares.
- The margin
parameter is optional. When given, it
- indicates the amount of vertical pixels around the given area
- that should be made visible as well.
-
- cm.cursorCoords (where: boolean|{line, ch}, mode: string) → {left, top, bottom}
- Returns an {left, top, bottom}
object
- containing the coordinates of the cursor position.
- If mode
is "local"
, they will be
- relative to the top-left corner of the editable document. If it
- is "page"
or not given, they are relative to the
- top-left corner of the page. If mode
- is "window"
, the coordinates are relative to the
- top-left corner of the currently visible (scrolled)
- window. where
can be a boolean indicating whether
- you want the start (true
) or the end
- (false
) of the selection, or, if a {line,
- ch}
object is given, it specifies the precise position at
- which you want to measure.
- cm.charCoords (pos: {line, ch}, ?mode: string) → {left, right, top, bottom}
- Returns the position and dimensions of an arbitrary
- character. pos
should be a {line, ch}
- object. This differs from cursorCoords
in that
- it'll give the size of the whole character, rather than just the
- position that the cursor would have when it would sit at that
- position.
- cm.coordsChar (object: {left, top}, ?mode: string) → {line, ch}
- Given an {left, top}
object (e.g. coordinates of a mouse event) returns
- the {line, ch}
position that corresponds to it. The
- optional mode
parameter determines relative to what
- the coordinates are interpreted. It may
- be "window"
, "page"
(the default),
- or "local"
.
- cm.lineAtHeight (height: number, ?mode: string) → number
- Computes the line at the given pixel
- height. mode
can be one of the same strings
- that coordsChar
- accepts.
- cm.heightAtLine (line: integer|LineHandle, ?mode: string, ?includeWidgets: bool) → number
- Computes the height of the top of a line, in the coordinate
- system specified by mode
- (see coordsChar
), which
- defaults to "page"
. When a line below the bottom of
- the document is specified, the returned value is the bottom of
- the last line in the document. By default, the position of the
- actual text is returned. If `includeWidgets` is true and the
- line has line widgets, the position above the first line widget
- is returned.
- cm.defaultTextHeight () → number
- Returns the line height of the default font for the editor.
- cm.defaultCharWidth () → number
- Returns the pixel width of an 'x' in the default font for
- the editor. (Note that for non-monospace fonts, this is mostly
- useless, and even for monospace fonts, non-ascii characters
- might have a different width).
-
- cm.getViewport () → {from: number, to: number}
- Returns a {from, to}
object indicating the
- start (inclusive) and end (exclusive) of the currently rendered
- part of the document. In big documents, when most content is
- scrolled out of view, CodeMirror will only render the visible
- part, and a margin around it. See also
- the viewportChange
- event.
-
- cm.refresh ()
- If your code does something to change the size of the editor
- element (window resizes are already listened for), or unhides
- it, you should probably follow up by calling this method to
- ensure CodeMirror is still looking as intended. See also
- the autorefresh addon .
-
-
- Mode, state, and token-related methods
-
- When writing language-aware functionality, it can often be
- useful to hook into the knowledge that the CodeMirror language
- mode has. See the section on modes for a
- more detailed description of how these work.
-
-
- doc.getMode () → object
- Gets the (outer) mode object for the editor. Note that this
- is distinct from getOption("mode")
, which gives you
- the mode specification, rather than the resolved, instantiated
- mode object .
-
- cm.getModeAt (pos: {line, ch}) → object
- Gets the inner mode at a given position. This will return
- the same as getMode
for
- simple modes, but will return an inner mode for nesting modes
- (such as htmlmixed
).
-
- cm.getTokenAt (pos: {line, ch}, ?precise: boolean) → object
- Retrieves information about the token the current mode found
- before the given position (a {line, ch}
object). The
- returned object has the following properties:
-
- start
The character (on the given line) at which the token starts.
- end
The character at which the token ends.
- string
The token's string.
- type
The token type the mode assigned
- to the token, such as "keyword"
- or "comment"
(may also be null).
- state
The mode's state at the end of this token.
-
- If precise
is true, the token will be guaranteed to be accurate based on recent edits. If false or
- not specified, the token will use cached state information, which will be faster but might not be accurate if
- edits were recently made and highlighting has not yet completed.
-
-
- cm.getLineTokens (line: integer, ?precise: boolean) → array<{start, end, string, type, state}>
- This is similar
- to getTokenAt
, but
- collects all tokens for a given line into an array. It is much
- cheaper than repeatedly calling getTokenAt
, which
- re-parses the part of the line before the token for every call.
-
- cm.getTokenTypeAt (pos: {line, ch}) → string
- This is a (much) cheaper version
- of getTokenAt
useful for
- when you just need the type of the token at a given position,
- and no other information. Will return null
for
- unstyled tokens, and a string, potentially containing multiple
- space-separated style names, otherwise.
-
- cm.getHelpers (pos: {line, ch}, type: string) → array<helper>
- Fetch the set of applicable helper values for the given
- position. Helpers provide a way to look up functionality
- appropriate for a mode. The type
argument provides
- the helper namespace (see
- registerHelper
), in
- which the values will be looked up. When the mode itself has a
- property that corresponds to the type
, that
- directly determines the keys that are used to look up the helper
- values (it may be either a single string, or an array of
- strings). Failing that, the mode's helperType
- property and finally the mode's name are used.
- For example, the JavaScript mode has a
- property fold
containing "brace"
. When
- the brace-fold
addon is loaded, that defines a
- helper named brace
in the fold
- namespace. This is then used by
- the foldcode
addon to
- figure out that it can use that folding function to fold
- JavaScript code.
- When any 'global'
- helpers are defined for the given namespace, their predicates
- are called on the current mode and editor, and all those that
- declare they are applicable will also be added to the array that
- is returned.
-
- cm.getHelper (pos: {line, ch}, type: string) → helper
- Returns the first applicable helper value.
- See getHelpers
.
-
- cm.getStateAfter (?line: integer, ?precise: boolean) → object
- Returns the mode's parser state, if any, at the end of the
- given line number. If no line number is given, the state at the
- end of the document is returned. This can be useful for storing
- parsing errors in the state, or getting other kinds of
- contextual information for a line. precise
is defined
- as in getTokenAt()
.
-
-
- Miscellaneous methods
-
-
- cm.operation (func: () → any) → any
- CodeMirror internally buffers changes and only updates its
- DOM structure after it has finished performing some operation.
- If you need to perform a lot of operations on a CodeMirror
- instance, you can call this method with a function argument. It
- will call the function, buffering up all changes, and only doing
- the expensive update after the function returns. This can be a
- lot faster. The return value from this method will be the return
- value of your function.
-
- cm.startOperation ()
- cm.endOperation ()
- In normal circumstances, use the above operation
- method. But if you want to buffer operations happening asynchronously,
- or that can't all be wrapped in a callback function, you can
- call startOperation
to tell CodeMirror to start
- buffering changes, and endOperation
to actually
- render all the updates. Be careful: if you use this
- API and forget to call endOperation
, the editor will
- just never update.
-
- cm.indentLine (line: integer, ?dir: string|integer)
- Adjust the indentation of the given line. The second
- argument (which defaults to "smart"
) may be one of:
-
- "prev"
- Base indentation on the indentation of the previous line.
- "smart"
- Use the mode's smart indentation if available, behave
- like "prev"
otherwise.
- "add"
- Increase the indentation of the line by
- one indent unit .
- "subtract"
- Reduce the indentation of the line.
- <integer>
- Add (positive number) or reduce (negative number) the
- indentation by the given amount of spaces.
-
-
- cm.toggleOverwrite (?value: boolean)
- Switches between overwrite and normal insert mode (when not
- given an argument), or sets the overwrite mode to a specific
- state (when given an argument).
-
- cm.isReadOnly () → boolean
- Tells you whether the editor's content can be edited by the
- user.
-
- doc.lineSeparator ()
- Returns the preferred line separator string for this
- document, as per the option
- by the same name. When that option is null
, the
- string "\n"
is returned.
-
- cm.execCommand (name: string)
- Runs the command with the given name on the editor.
-
- doc.posFromIndex (index: integer) → {line, ch}
- Calculates and returns a {line, ch}
object for a
- zero-based index
who's value is relative to the start of the
- editor's text. If the index
is out of range of the text then
- the returned object is clipped to start or end of the text
- respectively.
- doc.indexFromPos (object: {line, ch}) → integer
- The reverse of posFromIndex
.
-
- cm.focus ()
- Give the editor focus.
-
- cm.phrase (text: string) → string
- Allow the given string to be translated with
- the phrases
- option .
-
- cm.getInputField () → Element
- Returns the input field for the editor. Will be a textarea
- or an editable div, depending on the value of
- the inputStyle
- option.
- cm.getWrapperElement () → Element
- Returns the DOM node that represents the editor, and
- controls its size. Remove this from your tree to delete an
- editor instance.
- cm.getScrollerElement () → Element
- Returns the DOM node that is responsible for the scrolling
- of the editor.
- cm.getGutterElement () → Element
- Fetches the DOM node that contains the editor gutters.
-
-
- Static properties
- The CodeMirror
object itself provides
- several useful properties.
-
-
- CodeMirror.version : string
- It contains a string that indicates the version of the
- library. This is a triple of
- integers "major.minor.patch"
,
- where patch
is zero for releases, and something
- else (usually one) for dev snapshots.
-
- CodeMirror.fromTextArea (textArea: TextAreaElement, ?config: object)
- This method provides another way to initialize an editor. It
- takes a textarea DOM node as first argument and an optional
- configuration object as second. It will replace the textarea
- with a CodeMirror instance, and wire up the form of that
- textarea (if any) to make sure the editor contents are put into
- the textarea when the form is submitted. The text in the
- textarea will provide the content for the editor. A CodeMirror
- instance created this way has three additional methods:
-
- cm.save ()
- Copy the content of the editor into the textarea.
-
- cm.toTextArea ()
- Remove the editor, and restore the original textarea (with
- the editor's current content). If you dynamically create and
- destroy editors made with `fromTextArea`, without destroying
- the form they are part of, you should make sure to call
- `toTextArea` to remove the editor, or its `"submit"` handler
- on the form will cause a memory leak.
-
- cm.getTextArea () → TextAreaElement
- Returns the textarea that the instance was based on.
-
-
-
- CodeMirror.defaults : object
- An object containing default values for
- all options . You can assign to its
- properties to modify defaults (though this won't affect editors
- that have already been created).
-
- CodeMirror.defineExtension (name: string, value: any)
- If you want to define extra methods in terms of the
- CodeMirror API, it is possible to
- use defineExtension
. This will cause the given
- value (usually a method) to be added to all CodeMirror instances
- created from then on.
-
- CodeMirror.defineDocExtension (name: string, value: any)
- Like defineExtension
,
- but the method will be added to the interface
- for Doc
objects instead.
-
- CodeMirror.defineOption (name: string,
- default: any, updateFunc: function)
- Similarly, defineOption
can be used to define new options for
- CodeMirror. The updateFunc
will be called with the
- editor instance and the new value when an editor is initialized,
- and whenever the option is modified
- through setOption
.
-
- CodeMirror.defineInitHook (func: function)
- If your extension just needs to run some
- code whenever a CodeMirror instance is initialized,
- use CodeMirror.defineInitHook
. Give it a function as
- its only argument, and from then on, that function will be called
- (with the instance as argument) whenever a new CodeMirror instance
- is initialized.
-
- CodeMirror.registerHelper (type: string, name: string, value: helper)
- Registers a helper value with the given name
in
- the given namespace (type
). This is used to define
- functionality that may be looked up by mode. Will create (if it
- doesn't already exist) a property on the CodeMirror
- object for the given type
, pointing to an object
- that maps names to values. I.e. after
- doing CodeMirror.registerHelper("hint", "foo",
- myFoo)
, the value CodeMirror.hint.foo
will
- point to myFoo
.
-
- CodeMirror.registerGlobalHelper (type: string, name: string, predicate: fn(mode, CodeMirror), value: helper)
- Acts
- like registerHelper
,
- but also registers this helper as 'global', meaning that it will
- be included by getHelpers
- whenever the given predicate
returns true when
- called with the local mode and editor.
-
- CodeMirror.Pos (line: integer, ?ch: integer, ?sticky: string)
- A constructor for the objects that are used to represent
- positions in editor documents. sticky
defaults to
- null, but can be set to "before"
- or "after"
to make the position explicitly
- associate with the character before or after it.
-
- CodeMirror.changeEnd (change: object) → {line, ch}
- Utility function that computes an end position from a change
- (an object with from
, to
,
- and text
properties, as passed to
- various event handlers ). The
- returned position will be the end of the changed
- range, after the change is applied.
-
- CodeMirror.countColumn (line: string, index: number, tabSize: number) → number
- Find the column position at a given string index using a given tabsize.
-
-
-
-
- Addons
-
- The addon
directory in the distribution contains a
- number of reusable components that implement extra editor
- functionality (on top of extension functions
- like defineOption
, defineExtension
,
- and registerHelper
). In
- brief, they are:
-
-
- dialog/dialog.js
- Provides a very simple way to query users for text input.
- Adds the openDialog(template, callback, options) →
- closeFunction
method to CodeMirror instances,
- which can be called with an HTML fragment or a detached DOM
- node that provides the prompt (should include an input
- or button
tag), and a callback function that is called
- when the user presses enter. It returns a function closeFunction
- which, if called, will close the dialog immediately.
- openDialog
takes the following options:
-
- closeOnEnter : bool
- If true, the dialog will be closed when the user presses
- enter in the input. Defaults to true
.
- closeOnBlur : bool
- Determines whether the dialog is closed when it loses focus. Defaults to true
.
- onKeyDown : fn(event: KeyboardEvent, value: string, close: fn()) → bool
- An event handler that will be called whenever keydown
fires in the
- dialog's input. If your callback returns true
,
- the dialog will not do any further processing of the event.
- onKeyUp : fn(event: KeyboardEvent, value: string, close: fn()) → bool
- Same as onKeyDown
but for the
- keyup
event.
- onInput : fn(event: InputEvent, value: string, close: fn()) → bool
- Same as onKeyDown
but for the
- input
event.
- onClose : fn(instance)
:
- A callback that will be called after the dialog has been closed and
- removed from the DOM. No return value.
-
-
- Also adds an openNotification(template, options) →
- closeFunction
function that simply shows an HTML
- fragment as a notification at the top of the editor. It takes a
- single option: duration
, the amount of time after
- which the notification will be automatically closed. If
- duration
is zero, the dialog will not be closed automatically.
-
- Depends on addon/dialog/dialog.css
.
-
- search/searchcursor.js
- Adds the getSearchCursor(query, start, options) →
- cursor
method to CodeMirror instances, which can be used
- to implement search/replace functionality. query
- can be a regular expression or a string. start
- provides the starting position of the search. It can be
- a {line, ch}
object, or can be left off to default
- to the start of the document. options
is an
- optional object, which can contain the property `caseFold:
- false` to disable case folding when matching a string, or the
- property `multiline: disable` to disable multi-line matching for
- regular expressions (which may help performance). A search
- cursor has the following methods:
-
- findNext () → boolean
- findPrevious () → boolean
- Search forward or backward from the current position.
- The return value indicates whether a match was found. If
- matching a regular expression, the return value will be the
- array returned by the match
method, in case you
- want to extract matched groups.
- from () → {line, ch}
- to () → {line, ch}
- These are only valid when the last call
- to findNext
or findPrevious
did
- not return false. They will return {line, ch}
- objects pointing at the start and end of the match.
- replace (text: string, ?origin: string)
- Replaces the currently found match with the given text
- and adjusts the cursor position to reflect the
- replacement.
-
-
- search/search.js
- Implements the search commands. CodeMirror has keys bound to
- these by default, but will not do anything with them unless an
- implementation is provided. Depends
- on searchcursor.js
, and will make use
- of openDialog
when
- available to make prompting for search queries less ugly.
-
- search/jump-to-line.js
- Implements a jumpToLine
command and binding Alt-G
to it.
- Accepts linenumber
, +/-linenumber
, line:char
,
- scroll%
and :linenumber
formats.
- This will make use of openDialog
- when available to make prompting for line number neater. Demo available here .
-
- search/matchesonscrollbar.js
- Adds a showMatchesOnScrollbar
method to editor
- instances, which should be given a query (string or regular
- expression), optionally a case-fold flag (only applicable for
- strings), and optionally a class name (defaults
- to CodeMirror-search-match
) as arguments. When
- called, matches of the given query will be displayed on the
- editor's vertical scrollbar. The method returns an object with
- a clear
method that can be called to remove the
- matches. Depends on
- the annotatescrollbar
- addon, and
- the matchesonscrollbar.css
- file provides a default (transparent yellowish) definition of
- the CSS class applied to the matches. Note that the matches are
- only perfectly aligned if your scrollbar does not have buttons
- at the top and bottom. You can use
- the simplescrollbar
- addon to make sure of this. If this addon is loaded,
- the search
addon will
- automatically use it.
-
- edit/matchbrackets.js
- Defines an option matchBrackets
which, when set
- to true or an options object, causes matching brackets to be
- highlighted whenever the cursor is next to them. It also adds a
- method matchBrackets
that forces this to happen
- once, and a method findMatchingBracket
that can be
- used to run the bracket-finding algorithm that this uses
- internally. It takes a start position and an optional config
- object. By default, it will find the match to a matchable
- character either before or after the cursor (preferring the one
- before), but you can control its behavior with these options:
-
- afterCursor
- Only use the character after the start position, never the one before it.
- highlightNonMatching
- Also highlight pairs of non-matching as well as stray brackets. Enabled by default.
- strict
- Causes only matches where both brackets are at the same side of the start position to be considered.
- maxScanLines
- Stop after scanning this amount of lines without a successful match. Defaults to 1000.
- maxScanLineLength
- Ignore lines longer than this. Defaults to 10000.
- maxHighlightLineLength
- Don't highlight a bracket in a line longer than this. Defaults to 1000.
-
-
- edit/closebrackets.js
- Defines an option autoCloseBrackets
that will
- auto-close brackets and quotes when typed. By default, it'll
- auto-close ()[]{}''""
, but you can pass it a string
- similar to that (containing pairs of matching characters), or an
- object with pairs
and
- optionally explode
properties to customize
- it. explode
should be a similar string that gives
- the pairs of characters that, when enter is pressed between
- them, should have the second character also moved to its own
- line. By default, if the active mode has
- a closeBrackets
property, that overrides the
- configuration given in the option. But you can add
- an override
property with a truthy value to
- override mode-specific
- configuration. Demo
- here .
-
- edit/matchtags.js
- Defines an option matchTags
that, when enabled,
- will cause the tags around the cursor to be highlighted (using
- the CodeMirror-matchingtag
class). Also
- defines
- a command toMatchingTag
,
- which you can bind a key to in order to jump to the tag matching
- the one under the cursor. Depends on
- the addon/fold/xml-fold.js
- addon. Demo here.
-
- edit/trailingspace.js
- Adds an option showTrailingSpace
which, when
- enabled, adds the CSS class cm-trailingspace
to
- stretches of whitespace at the end of lines.
- The demo has a nice
- squiggly underline style for this class.
-
- edit/closetag.js
- Defines an autoCloseTags
option that will
- auto-close XML tags when '>
' or '/
'
- is typed, and
- a closeTag
command that
- closes the nearest open tag. Depends on
- the fold/xml-fold.js
addon. See
- the demo .
-
- edit/continuelist.js
- Markdown specific. Defines
- a "newlineAndIndentContinueMarkdownList"
command
- that can be bound to enter
to automatically
- insert the leading characters for continuing a list. See
- the Markdown mode
- demo .
-
-
- Addon for commenting and uncommenting code. Adds four
- methods to CodeMirror instances:
-
-
- Tries to uncomment the current selection, and if that
- fails, line-comments it.
-
- Set the lines in the given range to be line comments. Will
- fall back to blockComment
when no line comment
- style is defined for the mode.
-
- Wrap the code in the given range in a block comment. Will
- fall back to lineComment
when no block comment
- style is defined for the mode.
-
- Try to uncomment the given range.
- Returns true
if a comment range was found and
- removed, false
otherwise.
-
- The options
object accepted by these methods may
- have the following properties:
-
- blockCommentStart, blockCommentEnd, blockCommentLead, lineComment: string
- Override the comment string
- properties of the mode with custom comment strings.
- padding : string
- A string that will be inserted after opening and leading
- markers, and before closing comment markers. Defaults to a
- single space.
- commentBlankLines : boolean
- Whether, when adding line comments, to also comment lines
- that contain only whitespace.
- indent : boolean
- When adding line comments and this is turned on, it will
- align the comment block to the current indentation of the
- first line of the block.
- fullLines : boolean
- When block commenting, this controls whether the whole
- lines are indented, or only the precise range that is given.
- Defaults to true
.
-
- The addon also defines
- a toggleComment
command ,
- which is a shorthand command for calling
- toggleComment
with no options.
-
- fold/foldcode.js
- Helps with code folding. Adds a foldCode
method
- to editor instances, which will try to do a code fold starting
- at the given line, or unfold the fold that is already present.
- The method takes as first argument the position that should be
- folded (may be a line number or
- a Pos
), and as second optional
- argument either a range-finder function, or an options object,
- supporting the following properties:
-
- rangeFinder : fn(CodeMirror, Pos)
- The function that is used to find
- foldable ranges. If this is not directly passed, it will
- default to CodeMirror.fold.auto
, which
- uses getHelpers
with
- a "fold"
type to find folding functions
- appropriate for the local mode. There are files in
- the addon/fold/
- directory providing CodeMirror.fold.brace
, which
- finds blocks in brace languages (JavaScript, C, Java,
- etc), CodeMirror.fold.indent
, for languages where
- indentation determines block structure (Python, Haskell),
- and CodeMirror.fold.xml
, for XML-style languages,
- and CodeMirror.fold.comment
, for folding comment
- blocks.
- widget : string | Element | fn(from: Pos, to: Pos) → string|Element
- The widget to show for folded ranges. Can be either a
- string, in which case it'll become a span with
- class CodeMirror-foldmarker
, or a DOM node.
- To dynamically generate the widget, this can be a function
- that returns a string or DOM node, which will then render
- as described. The function will be invoked with parameters
- identifying the range to be folded.
- scanUp : boolean
- When true (default is false), the addon will try to find
- foldable ranges on the lines above the current one if there
- isn't an eligible one on the given line.
- minFoldSize : integer
- The minimum amount of lines that a fold should span to be
- accepted. Defaults to 0, which also allows single-line
- folds.
-
- See the demo for an
- example.
-
- fold/foldgutter.js
- Provides an option foldGutter
, which can be
- used to create a gutter with markers indicating the blocks that
- can be folded. Create a gutter using
- the gutters
option,
- giving it the class CodeMirror-foldgutter
or
- something else if you configure the addon to use a different
- class, and this addon will show markers next to folded and
- foldable blocks, and handle clicks in this gutter. Note that
- CSS styles should be applied to make the gutter, and the fold
- markers within it, visible. A default set of CSS styles are
- available in:
-
- addon/fold/foldgutter.css
- .
- The option
- can be either set to true
, or an object containing
- the following optional option fields:
-
- gutter : string
- The CSS class of the gutter. Defaults
- to "CodeMirror-foldgutter"
. You will have to
- style this yourself to give it a width (and possibly a
- background). See the default gutter style rules above.
- indicatorOpen : string | Element
- A CSS class or DOM element to be used as the marker for
- open, foldable blocks. Defaults
- to "CodeMirror-foldgutter-open"
.
- indicatorFolded : string | Element
- A CSS class or DOM element to be used as the marker for
- folded blocks. Defaults to "CodeMirror-foldgutter-folded"
.
- rangeFinder : fn(CodeMirror, Pos)
- The range-finder function to use when determining whether
- something can be folded. When not
- given, CodeMirror.fold.auto
- will be used as default.
-
- The foldOptions
editor option can be set to an
- object to provide an editor-wide default configuration.
- Demo here .
-
- runmode/runmode.js
- Can be used to run a CodeMirror mode over text without
- actually opening an editor instance.
- See the demo for an example.
- There are alternate versions of the file available for
- running stand-alone
- (without including all of CodeMirror) and
- for running under
- node.js (see bin/source-highlight
for an example of using the latter).
-
- runmode/colorize.js
- Provides a convenient way to syntax-highlight code snippets
- in a webpage. Depends on
- the runmode
addon (or
- its standalone variant). Provides
- a CodeMirror.colorize
function that can be called
- with an array (or other array-ish collection) of DOM nodes that
- represent the code snippets. By default, it'll get
- all pre
tags. Will read the data-lang
- attribute of these nodes to figure out their language, and
- syntax-color their content using the relevant CodeMirror mode
- (you'll have to load the scripts for the relevant modes
- yourself). A second argument may be provided to give a default
- mode, used when no language attribute is found for a node. Used
- in this manual to highlight example code.
-
- mode/overlay.js
- Mode combinator that can be used to extend a mode with an
- 'overlay' — a secondary mode is run over the stream, along with
- the base mode, and can color specific pieces of text without
- interfering with the base mode.
- Defines CodeMirror.overlayMode
, which is used to
- create such a mode. See this
- demo for a detailed example.
-
- mode/multiplex.js
- Mode combinator that can be used to easily 'multiplex'
- between several modes.
- Defines CodeMirror.multiplexingMode
which, when
- given as first argument a mode object, and as other arguments
- any number of {open, close, mode [, delimStyle, innerStyle, parseDelimiters]}
- objects, will return a mode object that starts parsing using the
- mode passed as first argument, but will switch to another mode
- as soon as it encounters a string that occurs in one of
- the open
fields of the passed objects. When in a
- sub-mode, it will go back to the top mode again when
- the close
string is encountered.
- Pass "\n"
for open
or close
- if you want to switch on a blank line.
- When delimStyle
is specified, it will be the token
- style returned for the delimiter tokens (as well as
- [delimStyle]-open
on the opening token and
- [delimStyle]-close
on the closing token).
- When innerStyle
is specified, it will be the token
- style added for each inner mode token.
- When parseDelimiters
is true, the content of
- the delimiters will also be passed to the inner mode.
- (And delimStyle
is ignored.) The outer
- mode will not see the content between the delimiters.
- See this demo for an
- example.
-
- hint/show-hint.js
- Provides a framework for showing autocompletion hints.
- Defines editor.showHint
, which takes an optional
- options object, and pops up a widget that allows the user to
- select a completion. Finding hints is done with a hinting
- function (the hint
option). This function
- takes an editor instance and an options object, and returns
- a {list, from, to}
object, where list
- is an array of strings or objects (the completions),
- and from
and to
give the start and end
- of the token that is being completed as {line, ch}
- objects. An optional selectedHint
property (an
- integer) can be added to the completion object to control the
- initially selected hint.
- If no hinting function is given, the addon will
- use CodeMirror.hint.auto
, which
- calls getHelpers
with
- the "hint"
type to find applicable hinting
- functions, and tries them one by one. If that fails, it looks
- for a "hintWords"
helper to fetch a list of
- completeable words for the mode, and
- uses CodeMirror.hint.fromList
to complete from
- those.
- When completions aren't simple strings, they should be
- objects with the following properties:
-
- text : string
- The completion text. This is the only required
- property.
- displayText : string
- The text that should be displayed in the menu.
- className : string
- A CSS class name to apply to the completion's line in the
- menu.
- render : fn(Element, self, data)
- A method used to create the DOM structure for showing the
- completion by appending it to its first argument.
- hint : fn(CodeMirror, self, data)
- A method used to actually apply the completion, instead of
- the default behavior.
- from : {line, ch}
- Optional from
position that will be used by pick()
instead
- of the global one passed with the full list of completions.
- to : {line, ch}
- Optional to
position that will be used by pick()
instead
- of the global one passed with the full list of completions.
-
-
- The plugin understands the following options, which may be
- either passed directly in the argument to showHint
,
- or provided by setting an hintOptions
editor
- option to an object (the former takes precedence). The options
- object will also be passed along to the hinting function, which
- may understand additional options.
-
- hint : function
- A hinting function, as specified above. It is possible to
- set the async
property on a hinting function to
- true, in which case it will be called with
- arguments (cm, callback, ?options)
, and the
- completion interface will only be popped up when the hinting
- function calls the callback, passing it the object holding the
- completions.
- The hinting function can also return a promise, and the completion
- interface will only be popped when the promise resolves.
- By default, hinting only works when there is no
- selection. You can give a hinting function
- a supportsSelection
property with a truthy value
- to indicate that it supports selections.
- completeSingle : boolean
- Determines whether, when only a single completion is
- available, it is completed without showing the dialog.
- Defaults to true.
- alignWithWord : boolean
- Whether the pop-up should be horizontally aligned with the
- start of the word (true, default), or with the cursor (false).
- closeCharacters : RegExp
- A regular expression object used to match characters which
- cause the pop up to be closed (default: /[\s()\[\]{};:>,]/
).
- If the user types one of these characters, the pop up will close, and
- the endCompletion
event is fired on the editor instance.
- closeOnUnfocus : boolean
- When enabled (which is the default), the pop-up will close
- when the editor is unfocused.
- completeOnSingleClick : boolean
- Whether a single click on a list item suffices to trigger the
- completion (which is the default), or if the user has to use a
- doubleclick.
- container : Element|null
- Can be used to define a custom container for the widget. The default
- is null
, in which case the body
-element will
- be used.
- customKeys : keymap
- Allows you to provide a custom key map of keys to be active
- when the pop-up is active. The handlers will be called with an
- extra argument, a handle to the completion menu, which
- has moveFocus(n)
, setFocus(n)
, pick()
,
- and close()
methods (see the source for details),
- that can be used to change the focused element, pick the
- current element or close the menu. Additionally menuSize()
- can give you access to the size of the current dropdown menu,
- length
give you the number of available completions, and
- data
give you full access to the completion returned by the
- hinting function.
- extraKeys : keymap
- Like customKeys
above, but the bindings will
- be added to the set of default bindings, instead of replacing
- them.
- scrollMargin : integer
- Show this many lines before and after the selected item.
- Default is 0.
-
- The following events will be fired on the completions object
- during completion:
-
- "shown" ()
- Fired when the pop-up is shown.
- "select" (completion, Element)
- Fired when a completion is selected. Passed the completion
- value (string or object) and the DOM node that represents it
- in the menu.
- "pick" (completion)
- Fired when a completion is picked. Passed the completion value
- (string or object).
- "close" ()
- Fired when the completion is finished.
-
- The following events will be fired on the editor instance during
- completion:
-
- "endCompletion" ()
- Fired when the pop-up is being closed programmatically, e.g., when
- the user types a character which matches the
- closeCharacters
option.
-
- This addon depends on styles
- from addon/hint/show-hint.css
. Check
- out the demo for an
- example.
-
- hint/javascript-hint.js
- Defines a simple hinting function for JavaScript
- (CodeMirror.hint.javascript
) and CoffeeScript
- (CodeMirror.hint.coffeescript
) code. This will
- simply use the JavaScript environment that the editor runs in as
- a source of information about objects and their properties.
-
- hint/xml-hint.js
- Defines CodeMirror.hint.xml
, which produces
- hints for XML tagnames, attribute names, and attribute values,
- guided by a schemaInfo
option (a property of the
- second argument passed to the hinting function, or the third
- argument passed to CodeMirror.showHint
). The
- schema info should be an object mapping tag names to information
- about these tags, with optionally a "!top"
property
- containing a list of the names of valid top-level tags. The
- values of the properties should be objects with optional
- properties children
(an array of valid child
- element names, omit to simply allow all tags to appear)
- and attrs
(an object mapping attribute names
- to null
for free-form attributes, and an array of
- valid values for restricted
- attributes). The hint options accept an additional property:
-
- matchInMiddle : boolean
- Determines whether typed characters are matched anywhere in
- completions, not just at the beginning. Defaults to false.
-
- Demo here .
-
- hint/html-hint.js
- Provides schema info to
- the xml-hint addon for HTML
- documents. Defines a schema
- object CodeMirror.htmlSchema
that you can pass to
- as a schemaInfo
option, and
- a CodeMirror.hint.html
hinting function that
- automatically calls CodeMirror.hint.xml
with this
- schema data. See
- the demo .
-
- hint/css-hint.js
- A hinting function for CSS, SCSS, or LESS code.
- Defines CodeMirror.hint.css
.
-
- hint/anyword-hint.js
- A very simple hinting function
- (CodeMirror.hint.anyword
) that simply looks for
- words in the nearby code and completes to those. Takes two
- optional options, word
, a regular expression that
- matches words (sequences of one or more character),
- and range
, which defines how many lines the addon
- should scan when completing (defaults to 500).
-
- hint/sql-hint.js
- A simple SQL hinter. Defines CodeMirror.hint.sql
.
- Takes two optional options, tables
, a object with
- table names as keys and array of respective column names as values,
- and defaultTable
, a string corresponding to a
- table name in tables
for autocompletion.
-
- search/match-highlighter.js
- Adds a highlightSelectionMatches
option that
- can be enabled to highlight all instances of a currently
- selected word. Can be set either to true or to an object
- containing the following options: minChars
, for the
- minimum amount of selected characters that triggers a highlight
- (default 2), style
, for the style to be used to
- highlight the matches (default "matchhighlight"
,
- which will correspond to CSS
- class cm-matchhighlight
), trim
, which
- controls whether whitespace is trimmed from the selection,
- and showToken
which can be set to true
- or to a regexp matching the characters that make up a word. When
- enabled, it causes the current word to be highlighted when
- nothing is selected (defaults to off).
- Demo here .
-
- lint/lint.js
- Defines an interface component for showing linting warnings,
- with pluggable warning sources
- (see html-lint.js
,
- json-lint.js
,
- javascript-lint.js
,
- coffeescript-lint.js
,
- and css-lint.js
- in the same directory). Defines a lint
option that
- can be set to an annotation source (for
- example CodeMirror.lint.javascript
), to an options
- object (in which case the getAnnotations
field is
- used as annotation source), or simply to true
. When
- no annotation source is
- specified, getHelper
with
- type "lint"
is used to find an annotation function.
- An annotation source function should, when given a document
- string, an options object, and an editor instance, return an
- array of {message, severity, from, to}
objects
- representing problems. When the function has
- an async
property with a truthy value, it will be
- called with an additional second argument, which is a callback
- to pass the array to.
- The linting function can also return a promise, in that case the linter
- will only be executed when the promise resolves.
- By default, the linter will run (debounced) whenever the document is changed.
- You can pass a lintOnChange: false
option to disable that.
- You can pass a selfContain: true
option to render the tooltip inside the editor instance.
- And a highlightLines
option to add a style to lines that contain problems.
- Depends on addon/lint/lint.css
. A demo can be
- found here .
-
- selection/mark-selection.js
- Causes the selected text to be marked with the CSS class
- CodeMirror-selectedtext
when the styleSelectedText
option
- is enabled. Useful to change the colour of the selection (in addition to the background),
- like in this demo .
-
- selection/active-line.js
- Defines a styleActiveLine
option that, when
- enabled, gives the wrapper of the line that contains the cursor
- the class CodeMirror-activeline
, adds a background
- with the class CodeMirror-activeline-background
,
- and adds the class CodeMirror-activeline-gutter
to
- the line's gutter space is enabled. The option's value may be a
- boolean or an object specifying the following options:
-
- nonEmpty : bool
- Controls whether single-line selections, or just cursor
- selections, are styled. Defaults to false (only cursor
- selections).
-
- See the demo .
-
- selection/selection-pointer.js
- Defines a selectionPointer
option which you can
- use to control the mouse cursor appearance when hovering over
- the selection. It can be set to a string,
- like "pointer"
, or to true, in which case
- the "default"
(arrow) cursor will be used. You can
- see a demo here .
-
- mode/loadmode.js
- Defines a CodeMirror.requireMode(modename, callback,
- options)
function that will try to load a given mode and
- call the callback when it succeeded. options
is an
- optional object that may contain:
-
- path : fn(modeName: string) → string
- Defines the way mode names are mapped to paths.
- loadMode : fn(path: string, cont: fn())
- Override the way the mode script is loaded. By default,
- this will use the CommonJS or AMD module loader if one is
- present, and fall back to creating
- a <script>
tag otherwise.
-
- This addon also
- defines CodeMirror.autoLoadMode(instance, mode)
,
- which will ensure the given mode is loaded and cause the given
- editor instance to refresh its mode when the loading
- succeeded. See the demo .
-
- mode/meta.js
- Provides meta-information about all the modes in the
- distribution in a single file.
- Defines CodeMirror.modeInfo
, an array of objects
- with {name, mime, mode}
properties,
- where name
is the human-readable
- name, mime
the MIME type, and mode
the
- name of the mode file that defines this MIME. There are optional
- properties mimes
, which holds an array of MIME
- types for modes with multiple MIMEs associated,
- and ext
, which holds an array of file extensions
- associated with this mode. Four convenience
- functions, CodeMirror.findModeByMIME
,
- CodeMirror.findModeByExtension
,
- CodeMirror.findModeByFileName
- and CodeMirror.findModeByName
are provided, which
- return such an object given a MIME, extension, file name or mode name
- string. Note that, for historical reasons, this file resides in the
- top-level mode
directory, not
- under addon
. Demo .
-
-
- Adds a continueComments
option, which sets whether the
- editor will make the next line continue a comment when you press Enter
- inside a comment block. Can be set to a boolean to enable/disable this
- functionality. Set to a string, it will continue comments using a custom
- shortcut. Set to an object, it will use the key
property for
- a custom shortcut and the boolean continueLineComment
- property to determine whether single-line comments should be continued
- (defaulting to true
).
-
- display/placeholder.js
- Adds a placeholder
option that can be used to
- make content appear in the editor when it is empty and not
- focused. It can hold either a string or a DOM node. Also gives
- the editor a CodeMirror-empty
CSS class whenever it
- doesn't contain any text.
- See the demo .
-
- display/fullscreen.js
- Defines an option fullScreen
that, when set
- to true
, will make the editor full-screen (as in,
- taking up the whole browser window). Depends
- on fullscreen.css
. Demo
- here .
-
- display/autorefresh.js
- This addon can be useful when initializing an editor in a
- hidden DOM node, in cases where it is difficult to
- call refresh
when the editor
- becomes visible. It defines an option autoRefresh
- which you can set to true to ensure that, if the editor wasn't
- visible on initialization, it will be refreshed the first time
- it becomes visible. This is done by polling every 250
- milliseconds (you can pass a value like {delay:
- 500}
as the option value to configure this). Note that
- this addon will only refresh the editor once when it
- first becomes visible, and won't take care of further restyling
- and resizing.
-
- scroll/simplescrollbars.js
- Defines two additional scrollbar
- models, "simple"
and "overlay"
- (see demo ) that can
- be selected with
- the scrollbarStyle
- option. Depends
- on simplescrollbars.css
,
- which can be further overridden to style your own
- scrollbars.
-
- scroll/annotatescrollbar.js
- Provides functionality for showing markers on the scrollbar
- to call out certain parts of the document. Adds a
- method annotateScrollbar
to editor instances that
- can be called, with a CSS class name as argument, to create a
- set of annotations. The method returns an object
- whose update
method can be called with a sorted array
- of {from: Pos, to: Pos}
objects marking the ranges
- to be highlighted. To detach the annotations, call the
- object's clear
method.
-
- display/rulers.js
- Adds a rulers
option, which can be used to show
- one or more vertical rulers in the editor. The option, if
- defined, should be given an array of {column [, className,
- color, lineStyle, width]}
objects or numbers (which
- indicate a column). The ruler will be displayed at the column
- indicated by the number or the column
property.
- The className
property can be used to assign a
- custom style to a ruler. Demo
- here .
-
- display/panel.js
- Defines an addPanel
method for CodeMirror
- instances, which places a DOM node above or below an editor, and
- shrinks the editor to make room for the node. The method takes
- as first argument as DOM node, and as second an optional options
- object. The Panel
object returned by this method
- has a clear
method that is used to remove the
- panel, and a changed
method that can be used to
- notify the addon when the size of the panel's DOM node has
- changed.
- The method accepts the following options:
-
- position : string
- Controls the position of the newly added panel. The
- following values are recognized:
-
- top (default)
- Adds the panel at the very top.
- after-top
- Adds the panel at the bottom of the top panels.
- bottom
- Adds the panel at the very bottom.
- before-bottom
- Adds the panel at the top of the bottom panels.
-
-
- before : Panel
- The new panel will be added before the given panel.
- after : Panel
- The new panel will be added after the given panel.
- replace : Panel
- The new panel will replace the given panel.
- stable : bool
- Whether to scroll the editor to keep the text's vertical
- position stable, when adding a panel above it. Defaults to false.
-
- When using the after
, before
or replace
options,
- if the panel doesn't exists or has been removed,
- the value of the position
option will be used as a fallback.
-
- A demo of the addon is available here .
-
-
- wrap/hardwrap.js
- Addon to perform hard line wrapping/breaking for paragraphs
- of text. Adds these methods to editor instances:
-
- wrapParagraph (?pos: {line, ch}, ?options: object)
- Wraps the paragraph at the given position.
- If pos
is not given, it defaults to the cursor
- position.
- wrapRange (from: {line, ch}, to: {line, ch}, ?options: object)
- Wraps the given range as one big paragraph.
- wrapParagraphsInRange (from: {line, ch}, to: {line, ch}, ?options: object)
- Wraps the paragraphs in (and overlapping with) the
- given range individually.
-
- The following options are recognized:
-
- paragraphStart , paragraphEnd : RegExp
- Blank lines are always considered paragraph boundaries.
- These options can be used to specify a pattern that causes
- lines to be considered the start or end of a paragraph.
- column : number
- The column to wrap at. Defaults to 80.
- wrapOn : RegExp
- A regular expression that matches only those
- two-character strings that allow wrapping. By default, the
- addon wraps on whitespace and after dash characters.
- killTrailingSpace : boolean
- Whether trailing space caused by wrapping should be
- preserved, or deleted. Defaults to true.
- forceBreak : boolean
- If set to true forces a break at column
in the case
- when no wrapOn
pattern is found in the range. If set to
- false allows line to overflow the column
limit if no
- wrapOn
pattern found. Defaults to true.
-
- A demo of the addon is available here .
-
-
- scroll/scrollpastend.js
- Defines an option `"scrollPastEnd"` that, when set to a
- truthy value, allows the user to scroll one editor height of
- empty space into view at the bottom of the editor.
-
- merge/merge.js
- Implements an interface for merging changes, using either a
- 2-way or a 3-way view. The CodeMirror.MergeView
- constructor takes arguments similar to
- the CodeMirror
- constructor, first a node to append the interface to, and then
- an options object. Options are passed through to the editors
- inside the view. These extra options are recognized:
-
- origLeft
and origRight : string
- If given these provide original versions of the
- document, which will be shown to the left and right of the
- editor in non-editable CodeMirror instances. The merge
- interface will highlight changes between the editable
- document and the original(s). To create a 2-way (as opposed
- to 3-way) merge view, provide only one of them.
- revertButtons : boolean
- Determines whether buttons that allow the user to revert
- changes are shown. Defaults to true.
- revertChunk : fn(mv: MergeView, from: CodeMirror, fromStart: Pos, fromEnd: Pos, to: CodeMirror, toStart: Pos, toEnd: Pos)
- Can be used to define custom behavior when the user
- reverts a changed chunk.
- connect : string
- Sets the style used to connect changed chunks of code.
- By default, connectors are drawn. When this is set
- to "align"
, the smaller chunk is padded to
- align with the bigger chunk instead.
- collapseIdentical : boolean|number
- When true (default is false), stretches of unchanged
- text will be collapsed. When a number is given, this
- indicates the amount of lines to leave visible around such
- stretches (which defaults to 2).
- allowEditingOriginals : boolean
- Determines whether the original editor allows editing.
- Defaults to false.
- showDifferences : boolean
- When true (the default), changed pieces of text are
- highlighted.
- chunkClassLocation : string|Array
- By default the chunk highlights are added
- using addLineClass
- with "background". Override this to customize it to be any
- valid `where` parameter or an Array of valid `where`
- parameters.
-
- The addon also defines commands "goNextDiff"
- and "goPrevDiff"
to quickly jump to the next
- changed chunk. Demo
- here .
-
- tern/tern.js
- Provides integration with
- the Tern JavaScript analysis
- engine, for completion, definition finding, and minor
- refactoring help. See the demo
- for a very simple integration. For more involved scenarios, see
- the comments at the top of
- the addon and the
- implementation of the
- (multi-file) demonstration
- on the Tern website .
-
-
-
-
- Writing CodeMirror Modes
-
- Modes typically consist of a single JavaScript file. This file
- defines, in the simplest case, a lexer (tokenizer) for your
- language—a function that takes a character stream as input,
- advances it past a token, and returns a style for that token. More
- advanced modes can also handle indentation for the language.
-
- This section describes the low-level mode interface. Many modes
- are written directly against this, since it offers a lot of
- control, but for a quick mode definition, you might want to use
- the simple mode addon .
-
- The mode script should
- call CodeMirror.defineMode
to
- register itself with CodeMirror. This function takes two
- arguments. The first should be the name of the mode, for which you
- should use a lowercase string, preferably one that is also the
- name of the files that define the mode (i.e. "xml"
is
- defined in xml.js
). The second argument should be a
- function that, given a CodeMirror configuration object (the thing
- passed to the CodeMirror
function) and an optional
- mode configuration object (as in
- the mode
option), returns
- a mode object.
-
- Typically, you should use this second argument
- to defineMode
as your module scope function (modes
- should not leak anything into the global scope!), i.e. write your
- whole mode inside this function.
-
- The main responsibility of a mode script is parsing
- the content of the editor. Depending on the language and the
- amount of functionality desired, this can be done in really easy
- or extremely complicated ways. Some parsers can be stateless,
- meaning that they look at one element (token ) of the code
- at a time, with no memory of what came before. Most, however, will
- need to remember something. This is done by using a state
- object , which is an object that is always passed when
- reading a token, and which can be mutated by the tokenizer.
-
- Modes that use a state must define
- a startState
method on their mode
- object. This is a function of no arguments that produces a state
- object to be used at the start of a document.
-
- The most important part of a mode object is
- its token (stream, state)
method. All
- modes must define this method. It should read one token from the
- stream it is given as an argument, optionally update its state,
- and return a style string, or null
for tokens that do
- not have to be styled. For your styles, you are encouraged to use
- the 'standard' names defined in the themes (without
- the cm-
prefix). If that fails, it is also possible
- to come up with your own and write your own CSS theme file.
-
-
A typical token string would
- be "variable"
or "comment"
. Multiple
- styles can be returned (separated by spaces), for
- example "string error"
for a thing that looks like a
- string but is invalid somehow (say, missing its closing quote).
- When a style is prefixed by "line-"
- or "line-background-"
, the style will be applied to
- the whole line, analogous to what
- the addLineClass
method
- does—styling the "text"
in the simple case, and
- the "background"
element
- when "line-background-"
is prefixed.
-
- The stream object that's passed
- to token
encapsulates a line of code (tokens may
- never span lines) and our current position in that line. It has
- the following API:
-
-
- eol () → boolean
- Returns true only if the stream is at the end of the
- line.
- sol () → boolean
- Returns true only if the stream is at the start of the
- line.
-
- peek () → string
- Returns the next character in the stream without advancing
- it. Will return a null
at the end of the
- line.
- next () → string
- Returns the next character in the stream and advances it.
- Also returns null
when no more characters are
- available.
-
- eat (match: string|regexp|function(char: string) → boolean) → string
- match
can be a character, a regular expression,
- or a function that takes a character and returns a boolean. If
- the next character in the stream 'matches' the given argument,
- it is consumed and returned. Otherwise, undefined
- is returned.
- eatWhile (match: string|regexp|function(char: string) → boolean) → boolean
- Repeatedly calls eat
with the given argument,
- until it fails. Returns true if any characters were eaten.
- eatSpace () → boolean
- Shortcut for eatWhile
when matching
- white-space.
- skipToEnd ()
- Moves the position to the end of the line.
- skipTo (str: string) → boolean
- Skips to the start of the next occurrence of the given string, if
- found on the current line (doesn't advance the stream if the
- string does not occur on the line). Returns true if the
- string was found.
- match (pattern: string, ?consume: boolean, ?caseFold: boolean) → boolean
- match (pattern: regexp, ?consume: boolean) → array<string>
- Act like a
- multi-character eat
—if consume
is true
- or not given—or a look-ahead that doesn't update the stream
- position—if it is false. pattern
can be either a
- string or a regular expression starting with ^
.
- When it is a string, caseFold
can be set to true to
- make the match case-insensitive. When successfully matching a
- regular expression, the returned value will be the array
- returned by match
, in case you need to extract
- matched groups.
-
- backUp (n: integer)
- Backs up the stream n
characters. Backing it up
- further than the start of the current token will cause things to
- break, so be careful.
- column () → integer
- Returns the column (taking into account tabs) at which the
- current token starts.
- indentation () → integer
- Tells you how far the current line has been indented, in
- spaces. Corrects for tab characters.
-
- current () → string
- Get the string between the start of the current token and
- the current stream position.
-
- lookAhead (n: number) → ?string
- Get the line n
(>0) lines after the current
- one, in order to scan ahead across line boundaries. Note that
- you want to do this carefully, since looking far ahead will make
- mode state caching much less effective.
-
- baseToken () → ?{type: ?string, size: number}
- Modes added
- through addOverlay
- (and only such modes) can use this method to inspect
- the current token produced by the underlying mode.
-
-
- By default, blank lines are simply skipped when
- tokenizing a document. For languages that have significant blank
- lines, you can define
- a blankLine (state)
method on your
- mode that will get called whenever a blank line is passed over, so
- that it can update the parser state.
-
- Because state object are mutated, and CodeMirror
- needs to keep valid versions of a state around so that it can
- restart a parse at any line, copies must be made of state objects.
- The default algorithm used is that a new state object is created,
- which gets all the properties of the old object. Any properties
- which hold arrays get a copy of these arrays (since arrays tend to
- be used as mutable stacks). When this is not correct, for example
- because a mode mutates non-array properties of its state object, a
- mode object should define
- a copyState
method, which is given a
- state and should return a safe copy of that state.
-
- If you want your mode to provide smart indentation
- (through the indentLine
- method and the indentAuto
- and newlineAndIndent
commands, to which keys can be
- bound ), you must define
- an indent (state, textAfter)
method
- on your mode object.
-
- The indentation method should inspect the given state object,
- and optionally the textAfter
string, which contains
- the text on the line that is being indented, and return an
- integer, the amount of spaces to indent. It should usually take
- the indentUnit
- option into account. An indentation method may
- return CodeMirror.Pass
to indicate that it
- could not come up with a precise indentation.
-
-
-
- Finally, a mode may define either
- an electricChars
or an electricInput
- property, which are used to automatically reindent the line when
- certain patterns are typed and
- the electricChars
- option is enabled. electricChars
may be a string, and
- will trigger a reindent whenever one of the characters in that
- string are typed. Often, it is more appropriate to
- use electricInput
, which should hold a regular
- expression, and will trigger indentation when the part of the
- line before the cursor matches the expression. It should
- usually end with a $
character, so that it only
- matches when the indentation-changing pattern was just typed, not when something was
- typed after the pattern.
-
- So, to summarize, a mode must provide
- a token
method, and it may
- provide startState
, copyState
,
- and indent
methods. For an example of a trivial mode,
- see the diff mode , for a more
- involved example, see the C-like
- mode .
-
- Sometimes, it is useful for modes to nest —to have one
- mode delegate work to another mode. An example of this kind of
- mode is the mixed-mode HTML
- mode . To implement such nesting, it is usually necessary to
- create mode objects and copy states yourself. To create a mode
- object, there are CodeMirror.getMode(options,
- parserConfig)
, where the first argument is a configuration
- object as passed to the mode constructor function, and the second
- argument is a mode specification as in
- the mode
option. To copy a
- state object, call CodeMirror.copyState(mode, state)
,
- where mode
is the mode that created the given
- state.
-
- In a nested mode, it is recommended to add an
- extra method, innerMode
which, given
- a state object, returns a {state, mode}
object with
- the inner mode and its state for the current position. These are
- used by utility scripts such as the tag
- closer to get context information. Use
- the CodeMirror.innerMode
helper function to, starting
- from a mode and a state, recursively walk down to the innermost
- mode and state.
-
- To make indentation work properly in a nested parser, it is
- advisable to give the startState
method of modes that
- are intended to be nested an optional argument that provides the
- base indentation for the block of code. The JavaScript and CSS
- parser do this, for example, to allow JavaScript and CSS code
- inside the mixed-mode HTML mode to be properly indented.
-
- It is possible, and encouraged, to associate
- your mode, or a certain configuration of your mode, with
- a MIME type. For
- example, the JavaScript mode associates itself
- with text/javascript
, and its JSON variant
- with application/json
. To do this,
- call CodeMirror.defineMIME (mime,
- modeSpec)
, where modeSpec
can be a string or
- object specifying a mode, as in
- the mode
option.
-
- If a mode specification wants to add some properties to the
- resulting mode object, typically for use
- with getHelpers
, it may
- contain a modeProps
property, which holds an object.
- This object's properties will be copied to the actual mode
- object.
-
- Sometimes, it is useful to add or override mode
- object properties from external code.
- The CodeMirror.extendMode
function
- can be used to add properties to mode objects produced for a
- specific mode. Its first argument is the name of the mode, its
- second an object that specifies the properties that should be
- added. This is mostly useful to add utilities that can later be
- looked up through getMode
.
-
-
-
- VIM Mode API
-
- CodeMirror has a robust VIM mode that attempts to faithfully
- emulate VIM's most useful features. It can be enabled by
- including keymap/vim.js
- and setting the keyMap
option to
- "vim"
.
-
- Configuration
-
- VIM mode accepts configuration options for customizing
- behavior at run time. These methods can be called at any time
- and will affect all existing CodeMirror instances unless
- specified otherwise. The methods are exposed on the
- CodeMirror.Vim
object.
-
-
- setOption(name: string, value: any, ?cm: CodeMirror, ?cfg: object)
- Sets the value of a VIM option. name
should
- be the name of an option. If cfg.scope
is not set
- and cm
is provided, then sets the global and
- instance values of the option. Otherwise, sets either the
- global or instance value of the option depending on whether
- cfg.scope
is global
or
- local
.
- getOption(name: string, ?cm: CodeMirror: ?cfg: object)
- Gets the current value of a VIM option. If
- cfg.scope
is not set and cm
is
- provided, then gets the instance value of the option, falling
- back to the global value if not set. If cfg.scope
is provided, then gets the global
or
- local
value without checking the other.
-
- map(lhs: string, rhs: string, ?context: string)
- Maps a key sequence to another key sequence. Implements
- VIM's :map
command. To map ; to : in VIM would be
- :map ; :
. That would translate to
- CodeMirror.Vim.map(';', ':');
.
- The context
can be normal
,
- visual
, or insert
, which correspond
- to :nmap
, :vmap
, and
- :imap
- respectively.
-
- mapCommand(keys: string, type: string, name: string, ?args: object, ?extra: object)
- Maps a key sequence to a motion
,
- operator
, or action
type command.
- The args object is passed through to the command when it is
- invoked by the provided key sequence.
- extras.context
can be normal
,
- visual
, or insert
, to map the key
- sequence only in the corresponding mode.
- extras.isEdit
is applicable only to actions,
- determining whether it is recorded for replay for the
- .
single-repeat command.
-
- unmap(lhs: string, ctx: string)
-
- Remove the command lhs
if it is a user defined command.
- If the command is an Ex to Ex or Ex to key mapping then the context
- must be undefined
or false
.
-
-
- mapclear(ctx: string)
-
- Remove all user-defined mappings for the provided context.
-
-
- noremap(lhs: string, rhs: string, ctx: {string, array<string>})
-
- Non-recursive map function. This will not create mappings to key maps
- that aren't present in the default key map.
- If no context is provided then the mapping will be applied to each of
- normal, insert, and visual mode.
-
-
-
- Events
-
- VIM mode signals a few events on the editor instance. For an example usage, see demo/vim.html#L101 .
-
-
- "vim-command-done" (reason: undefined)
- Fired on keypress and mousedown where command has completed or no command found.
-
- "vim-keypress" (vimKey: string)
- Fired on keypress, vimKey
is in Vim's key notation.
-
- "vim-mode-change" (modeObj: object)
- Fired after mode change, modeObj
parameter is a {mode: string, ?subMode: string}
object. Modes: "insert", "normal", "replace", "visual"
. Visual sub-modes: "linewise", "blockwise"
.
-
-
- Extending VIM
-
- CodeMirror's VIM mode implements a large subset of VIM's core
- editing functionality. But since there's always more to be
- desired, there is a set of APIs for extending VIM's
- functionality. As with the configuration API, the methods are
- exposed on CodeMirror.Vim
and may
- be called at any time.
-
-
- defineOption(name: string, default: any, type: string, ?aliases: array<string>, ?callback: function (?value: any, ?cm: CodeMirror) → ?any)
- Defines a VIM style option and makes it available to the
- :set
command. Type can be boolean
or
- string
, used for validation and by
- :set
to determine which syntax to accept. If a
- callback
is passed in, VIM does not store the value of the
- option itself, but instead uses the callback as a setter/getter. If the
- first argument to the callback is undefined
, then the
- callback should return the value of the option. Otherwise, it should set
- instead. Since VIM options have global and instance values, whether a
- CodeMirror
instance is passed in denotes whether the global
- or local value should be used. Consequently, it's possible for the
- callback to be called twice for a single setOption
or
- getOption
call. Note that right now, VIM does not support
- defining buffer-local options that do not have global values. If an
- option should not have a global value, either always ignore the
- cm
parameter in the callback, or always pass in a
- cfg.scope
to setOption
and
- getOption
.
-
- defineMotion(name: string, fn: function(cm: CodeMirror, head: {line, ch}, ?motionArgs: object}) → {line, ch})
- Defines a motion command for VIM. The motion should return
- the desired result position of the cursor. head
- is the current position of the cursor. It can differ from
- cm.getCursor('head')
if VIM is in visual mode.
- motionArgs
is the object passed into
- mapCommand()
.
-
- defineOperator(name: string, fn: function(cm: CodeMirror, ?operatorArgs: object, ranges: array<{anchor, head}>) → ?{line, ch})
- Defines an operator command, similar to
- defineMotion
. ranges
is the range
- of text the operator should operate on. If the cursor should
- be set to a certain position after the operation finishes, it
- can return a cursor object.
-
- defineAction(name: string, fn: function(cm: CodeMirror, ?actionArgs: object))
- Defines an action command, similar to
- defineMotion
. Action commands
- can have arbitrary behavior, making them more flexible than
- motions and operators, at the loss of orthogonality.
-
- defineEx(name: string, ?prefix: string, fn: function(cm: CodeMirror, ?params: object))
- Defines an Ex command, and maps it to :name
.
- If a prefix is provided, it, and any prefixed substring of the
- name
beginning with the prefix
can
- be used to invoke the command. If the prefix
is
- falsy, then name
is used as the prefix.
- params.argString
contains the part of the prompted
- string after the command name. params.args
is
- params.argString
split by whitespace. If the
- command was prefixed with a
- line range
,
- params.line
and params.lineEnd
will
- be set.
-
- getRegisterController()
- Returns the RegisterController that manages the state of registers
- used by vim mode. For the RegisterController api see its
- definition here .
-
-
- buildKeyMap()
-
- Not currently implemented. If you would like to contribute this please open
- a pull request on GitHub .
-
-
- defineRegister()
- Defines an external register. The name should be a single character
- that will be used to reference the register. The register should support
- setText
, pushText
, clear
, and toString
.
- See Register for a reference implementation.
-
-
- getVimGlobalState_()
-
- Return a reference to the VimGlobalState.
-
-
- resetVimGlobalState_()
-
- Reset the default values of the VimGlobalState to fresh values. Any options
- set with setOption
will also be applied to the reset global state.
-
-
- maybeInitVimState_(cm: CodeMirror)
-
- Initialize cm.state.vim
if it does not exist. Returns cm.state.vim
.
-
-
- handleKey(cm: CodeMirror, key: string, origin: string)
-
- Convenience function to pass the arguments to findKey
and
- call returned function if it is defined.
-
-
- findKey(cm: CodeMirror, key: string, origin: string)
-
- This is the outermost function called by CodeMirror, after keys have
- been mapped to their Vim equivalents. Finds a command based on the key
- (and cached keys if there is a multi-key sequence). Returns undefined
- if no key is matched, a noop function if a partial match is found (multi-key),
- and a function to execute the bound command if a a key is matched. The
- function always returns true.
-
-
- suppressErrorLogging : boolean
- Whether to use suppress the use of console.log
when catching an
- error in the function returned by findKey
.
- Defaults to false.
-
- exitVisualMode(cm: CodeMirror, ?moveHead: boolean)
- Exit visual mode. If moveHead is set to false, the CodeMirror selection
- will not be touched. The caller assumes the responsibility of putting
- the cursor in the right place.
-
-
- exitInsertMode(cm: CodeMirror)
-
- Exit insert mode.
-
-
-
-
-
-
-
-
diff --git a/release/libraries/codemirror/doc/realworld.html b/release/libraries/codemirror/doc/realworld.html
deleted file mode 100644
index 5120167..0000000
--- a/release/libraries/codemirror/doc/realworld.html
+++ /dev/null
@@ -1,207 +0,0 @@
-
-
-CodeMirror: Real-world Uses
-
-
-
-
-
-
-
-CodeMirror real-world uses
-
- Create a pull
- request if you'd like your project to be added to this list.
-
-