@singapore-editor/scope-lines
v0.2.15
Published
Indent guides, sticky headers, and bracket pair colors for the Singapore editor.
Maintainers
Readme
@singapore-editor/scope-lines
Indent guides, sticky headers, and bracket pair colors for the Singapore editor.
Part of Singapore. A code editor for the browser that keeps every version.
Install
npm install @singapore-editor/core @singapore-editor/scope-linesUsage
import { Editor } from '@singapore-editor/core/editor'
import {
createBracketColorsPlugin,
createScopeLinesPlugin,
createStickyScrollPlugin,
} from '@singapore-editor/scope-lines'
const host = document.createElement('div')
host.style.height = '400px'
document.body.append(host)
const editor = new Editor(host, {
plugins: [createScopeLinesPlugin(), createStickyScrollPlugin(), createBracketColorsPlugin()],
})
editor.setText('const value = 1\n')API highlights
createScopeLinesPlugin()draws indent guides.createStickyScrollPlugin()keeps enclosing headers visible.createBracketColorsPlugin()colors bracket nesting.
In the Singapore family
@singapore-editor/core owns the editor view. Add these plugins to show enclosing scopes and bracket nesting.
Bracket pair colors need a syntax plugin. Indent guides and sticky headers can use indentation.
Singapore README · Documentation
License
MIT. License
