Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Repository files navigation

<code-mirror>

Build Status

This Polymer element wraps the CodeMirror text editor.

Demo

Check it live!

Install

Add this to your package's pubspec.yaml file:

dependencies:
codemirror_element: any

You can install packages from the command line:

$ pub get

Usage

Import Custom Element:

<linkrel="import" href="packages/codemirror_element/codemirror.html">

Start using it!

<code-mirror></code-mirror>

Options

AttributeOptionsDefaultDescription
valuestringThe value of the editor.
modestringThe mode to use.
themestringThe theme to style the editor with.
lineNumbersboolfalseWhether to show line numbers to the left of the editor.
indentWithTabsboolfalseWhether, when indenting, the first N*tabSize spaces should be replaced by N tabs.
autoCloseTagsboolfalseDefines an autoCloseTags option that will auto-close XML tags when '>' or '/' is typed.

Methods

MethodParametersReturnsDescription
focus()None.Nothing.Give the editor focus.
refresh()None.Nothing.Ensure CodeMirror is still looking as intended.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

For detailed changelog, check CHANGELOG.

License

BSD license

About

Polymer element wrapping the CodeMirror text editor.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages