An Ember component wrapping Ace editor.
ember install ember-ace
See the application controller in this addon's dummy application for usage examples of many of these options.
value
: the string value of the editorupdate(newValue)
: an action triggered when the value of the editor changesready(editor)
: an action triggered when the AceEditor
is instantiated
mode
: the mode for the editor to operate in, either a string (e.g."ace/mode/javascript"
) or aMode
instancetheme
: the color scheme to be used (e.g."ace/theme/chaos"
);useSoftTabs
: a boolean indicating whether to use spaces for indentationtabSize
: the number of spaces a tab representsuseWrapMode
: a boolean indicating whether to wrap long lineshighlightActiveLine
: a boolean indicating whether the active line should be highlightedshowPrintMargin
: a boolean indicating whether a line indicating the print margin should be shownprintMarginColumn
: a boolean indicating what column the print margin (if enabled) should appear atshowInvisibles
: a boolean indicating whether to show invisible charactersreadOnly
: a boolean indicating whether the editor is locked to the usershowLineNumbers
: a boolean indicating if line numbers are shown in the left gutter. Default to true.
lines
: the number of lines the editor should show (shorthand for setting bothminLines
andmaxLines
)minLines
: the minimum number of lines the editor should containmaxLines
: the maximum number of lines the editor should expand to
markers
: an array of marker objects, each containing the following keys:class
: the class name that should be applied to the element(s) overlaying the marked textrange
: anAce.Range
instance denoting the section of text to be markedinFront
: a boolean (defaulttrue
) indicating whether the marker should be in front of or behind the text layer
annotations
: an array of line annotation objects, each of which contains the following keys:type
: one oferror
,warning
orinfo
row
: the zero-based index of the row the annotation should appear ontext
: the text to appear when the annotation is hovered
Build configuration can be specified in an ace
key in ember-cli-build.js
:
new EmberApp(defaults, {
ace: {
themes: ['ambiance', 'chaos'],
modes: ['javascript'],
workers: ['javascript']
}
});
For each of the following types, you may specify an array of names to be included in your Ace build (as above).
modes
: syntax highlighting and editor behaviors for different languages (see all)workers
: background workers to perform more expensive processing available for some modes (see all, intermingled with modes)themes
: color schemes for the editor (see all)exts
: editor extensions, like spellcheck and Emmet abbreviations (see all)keybindings
: common keybindings from editors like Emacs and Vim (see all)