6.10.2 • Published 4 months ago

@codemirror/merge v6.10.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@codemirror/merge NPM version

[ WEBSITE | ISSUES | FORUM | CHANGELOG ]

This package implements a merge interface for the CodeMirror code editor.

The project page has more information, a number of examples and the documentation.

This code is released under an MIT license.

We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.

Usage

A split merge view can be created like this:

import {MergeView} from "@codemirror/merge"
import {EditorView, basicSetup} from "codemirror"
import {EditorState} from "@codemirror/state"

let doc = `one
two
three
four
five`

const view = new MergeView({
  a: {
    doc,
    extensions: basicSetup
  },
  b: {
    doc: doc.replace(/t/g, "T") + "\nSix",
    extensions: [
      basicSetup,
      EditorView.editable.of(false),
      EditorState.readOnly.of(true)
    ]
  },
  parent: document.body
})

Or a unified view like this:

import {EditorView, basicSetup} from "codemirror"
import {unifiedMergeView} from "@codemirror/merge"

const view = new EditorView({
  parent: document.body,
  doc: "one\ntwo\nthree\nfour",
  extensions: [
    basicSetup,
    unifiedMergeView({
      original: "one\n...\nfour"
    })
  ]
})

API Reference

Side-by-side Merge View

6.10.2

4 months ago

6.10.1

5 months ago

6.10.0

8 months ago

6.9.0

8 months ago

6.8.0

10 months ago

6.7.4

11 months ago

6.7.3

12 months ago

6.7.5

10 months ago

6.7.2

1 year ago

6.7.1

1 year ago

6.7.0

1 year ago

6.6.3

1 year ago

6.6.5

1 year ago

6.6.4

1 year ago

6.6.7

1 year ago

6.6.6

1 year ago

6.6.2

1 year ago

6.6.1

2 years ago

6.6.0

2 years ago

6.5.0

2 years ago

6.4.0

2 years ago

6.3.1

2 years ago

6.3.0

2 years ago

6.1.2

2 years ago

6.2.0

2 years ago

6.1.3

2 years ago

6.1.1

2 years ago

6.1.0

2 years ago

6.0.2

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago