From 69fa5fd886cb6cc77ff5df40bc15c194996cc215 Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke Add-ons
functionality. In brief, they are:
dialog.js
dialog/dialog.js
openDialog
method to CodeMirror instances,
which can be called with an HTML fragment that provides the
prompt (should include an input
tag), and a
callback function that is called when text has been entered.
Depends on addon/dialog/dialog.css
.searchcursor.js
search/searchcursor.js
getSearchCursor(query, start, caseFold) →
cursor
method to CodeMirror instances, which can be used
to implement search/replace functionality. query
@@ -1393,14 +1393,14 @@ search.js
search/search.js
searchcursor.js
, and will make use
of openDialog
when
available to make prompting for search queries less ugly.matchbrackets.js
edit/matchbrackets.js
matchBrackets
which, when set
to true, causes matching brackets to be highlighted whenever the
cursor is next to them. It also adds a
@@ -1408,14 +1408,14 @@ findMatchingBracket
that can be
used to run the bracket-finding algorithm that this uses
internally.closebrackets.js
edit/closebrackets.js
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)
to customize it. Demo
here.foldcode.js
fold/foldcode.js
CodeMirror.newFoldFunction
with a range-finder
@@ -1431,12 +1431,12 @@ CodeMirror.tagRangeFinder
, for XML-style
languages.collapserange.js
fold/collapserange.js
runmode.js
runmode/runmode.js
overlay.js
mode/overlay.js
CodeMirror.overlayMode
, which is used to
create such a mode. See this
demo for a detailed example.multiplex.js
mode/multiplex.js
CodeMirror.multiplexingMode
which, when
@@ -1472,7 +1472,7 @@ show-hint.js
hint/show-hint.js
CodeMirror.showHint
, which takes a
CodeMirror instance and a hinting function, and pops up a widget
@@ -1482,44 +1482,41 @@ from
and to
give the start and end of the token that is
being completed. Depends
- on addon/hint/show-hint.css
.
- See the demo for an
+ on addon/hint/show-hint.css
. See the other files in
+ the addon/hint
for
+ hint sources for various languages. Check
+ out the demo for an
example.simple-hint.js
CodeMirror.simpleHint
, which is
- compatible with showHint
. Deprecated,
- use showHint
instead. Depends
- on addon/hint/simple-hint.css
.javascript-hint.js
CodeMirror.javascriptHint
- and CodeMirror.coffeescriptHint
, which are simple
- hinting functions for the JavaScript and CoffeeScript
- modes.xml-hint.js
CodeMirror.xmlHint
, a hinting function
- for XML (which requires a schema to be defined).python-hint.js
CodeMirror.pythonHint
, a hinter for Python code.match-highlighter.js
highlightSelectionMatches
option that
can be enabled to highlight all instances of a currently
selected word.
Demo here.mark-selection.js
lint/lint.js
json-lint.js
+ and javascript-lint.js
+ in the same directory). Defines a lintWith
option
+ that can be set to a warning source (for
+ example CodeMirror.javascriptValidator
). Depends
+ on addon/lint/lint.css
. A demo can be
+ found here.selection/mark-selection.js
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.active-line.js
selection/active-line.js
styleActiveLine
option that, when enabled,
gives the wrapper of the active line the class CodeMirror-activeline
,
and adds a background with the class CodeMirror-activeline-background
.
is enabled. See the demo.closetag.js
edit/closetag.js
loadmode.js
mode/loadmode.js
CodeMirror.requireMode(modename,
callback)
function that will try to load a given mode and
call the callback when it succeeded. You'll have to
@@ -1531,7 +1528,7 @@ continuecomment.js
edit/continuecomment.js
newlineAndIndentContinueComment
that you can
bind Enter
to in order to have the editor prefix