mirror of
https://github.com/wickedest/Mergely.git
synced 2026-04-01 10:18:36 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dcbd0b910 | ||
|
|
b9aed167f3 |
16
README.md
16
README.md
@@ -84,13 +84,15 @@ Mergely will emit an `updated` event when the editor is first initialized, and e
|
|||||||
|
|
||||||
### Visualization modes
|
### Visualization modes
|
||||||
|
|
||||||
Mergely supports the following CodeMirror visualizations for [mode](codemirror.net/5/doc/manual.html#option_mode):
|
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:
|
||||||
* go
|
```
|
||||||
* javascript
|
require('codemirror/mode/go/go.js');
|
||||||
* htmlmixed
|
require('codemirror/mode/javascript/javascript.js');
|
||||||
* markdown
|
require('codemirror/mode/htmlmixed/htmlmixed.js');
|
||||||
* python
|
require('codemirror/mode/markdown/markdown.js');
|
||||||
|
require('codemirror/mode/python/python.js');
|
||||||
|
```
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ function CodeMirrorDiffView(el, options) {
|
|||||||
const coords = this.cursorCoords(null, 'local');
|
const coords = this.cursorCoords(null, 'local');
|
||||||
this.scrollTo(null,
|
this.scrollTo(null,
|
||||||
(coords.top + coords.bottom) / 2 - (this.getScrollerElement().clientHeight / 2));
|
(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 trace = console.log;
|
||||||
const traceTimeStart = console.time;
|
const traceTimeStart = console.time;
|
||||||
|
|||||||
@@ -253,6 +253,8 @@ class Mergely {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Mergely.CodeMirror = CodeMirrorDiffView.CodeMirror;
|
||||||
|
|
||||||
window.Mergely = Mergely;
|
window.Mergely = Mergely;
|
||||||
|
|
||||||
module.exports = Mergely;
|
module.exports = Mergely;
|
||||||
|
|||||||
Reference in New Issue
Block a user