1
0
mirror of synced 2025-12-25 17:15:17 +08:00

Compare commits

..

3 Commits

Author SHA1 Message Date
semantic-release-bot
aa496078fd chore(release): 5.4.0 [skip ci]
# [5.4.0](https://github.com/wickedest/Mergely/compare/v5.3.6...v5.4.0) (2025-11-15)

### Features

* **#220:** Exposes Mergely's instance of CodeMirror as Mergely.CodeMirror ([#221](https://github.com/wickedest/Mergely/issues/221)) ([d6d8d06](d6d8d06acc)), closes [#220](https://github.com/wickedest/Mergely/issues/220)
2025-11-15 15:43:30 +00:00
Jamie Peabody
d6d8d06acc feat(#220): Exposes Mergely's instance of CodeMirror as Mergely.CodeMirror (#221) 2025-11-15 15:42:29 +00:00
Moritz
b9aed167f3 Fix documentation for CM modes in README.md (#218) 2025-01-17 17:10:33 +00:00
6 changed files with 26 additions and 13 deletions

View File

@@ -1,3 +1,10 @@
# [5.4.0](https://github.com/wickedest/Mergely/compare/v5.3.6...v5.4.0) (2025-11-15)
### Features
* **#220:** Exposes Mergely's instance of CodeMirror as Mergely.CodeMirror ([#221](https://github.com/wickedest/Mergely/issues/221)) ([d6d8d06](https://github.com/wickedest/Mergely/commit/d6d8d06accaa4fa3a4352b95620e3e456226d444)), closes [#220](https://github.com/wickedest/Mergely/issues/220)
## [5.3.6](https://github.com/wickedest/Mergely/compare/v5.3.5...v5.3.6) (2024-10-11)

View File

@@ -84,13 +84,15 @@ Mergely will emit an `updated` event when the editor is first initialized, and e
### Visualization modes
Mergely supports the following CodeMirror visualizations for [mode](codemirror.net/5/doc/manual.html#option_mode):
* go
* javascript
* htmlmixed
* markdown
* python
Mergely does not support any CodeMirror highlighting for different languages (xml, html, javascript etc.) out of the box.
You can compile your own Mergely-Version with support for the desired modes by adding them to diff-view.js. For example:
```
require('codemirror/mode/go/go.js');
require('codemirror/mode/javascript/javascript.js');
require('codemirror/mode/htmlmixed/htmlmixed.js');
require('codemirror/mode/markdown/markdown.js');
require('codemirror/mode/python/python.js');
```
## Options

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "mergely",
"version": "5.3.6",
"version": "5.4.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mergely",
"version": "5.3.6",
"version": "5.4.0",
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
"devDependencies": {
"@babel/core": "^7.1.6",

View File

@@ -1,6 +1,6 @@
{
"name": "mergely",
"version": "5.3.6",
"version": "5.4.0",
"description": "A javascript UI for diff/merge",
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
"author": {

View File

@@ -18,9 +18,11 @@ function CodeMirrorDiffView(el, options) {
const coords = this.cursorCoords(null, 'local');
this.scrollTo(null,
(coords.top + coords.bottom) / 2 - (this.getScrollerElement().clientHeight / 2));
});
this.init(el, options);
};
});
this.init(el, options);
};
CodeMirrorDiffView.CodeMirror = CodeMirror;
const trace = console.log;
const traceTimeStart = console.time;

View File

@@ -253,6 +253,8 @@ class Mergely {
}
}
Mergely.CodeMirror = CodeMirrorDiffView.CodeMirror;
window.Mergely = Mergely;
module.exports = Mergely;