Skip to content

Commit

Permalink
feat: support CM modes: go, javascript, htmlmixed, markdown, python
Browse files Browse the repository at this point in the history
  • Loading branch information
wickedest committed Aug 27, 2023
1 parent bc46617 commit 827487a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ Mergely will emit an `updated` event when the editor is first initialized, and e
</body>
```

### Visualization modes

Mergely supports the following CodeMirror visualizations for [mode](codemirror.net/5/doc/manual.html#option_mode):

* go
* javascript
* htmlmixed
* markdown
* python

## Options

|Option|Type|Default value|Description|
Expand Down
6 changes: 6 additions & 0 deletions src/diff-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ const CodeMirror = require('codemirror');
require('codemirror/addon/search/searchcursor.js');
require('codemirror/addon/selection/mark-selection.js');
require('codemirror/lib/codemirror.css');
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');

const dom = require('./dom.js');
const VDoc = require('./vdoc');

Expand Down
3 changes: 2 additions & 1 deletion src/mergely.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const defaultOptions = {
vpcolor: 'rgba(0, 0, 200, 0.5)',
license: 'lgpl',
cmsettings: {
styleSelectedText: true
styleSelectedText: true,
mode: null
},
lhs_cmsettings: {},
rhs_cmsettings: {},
Expand Down
3 changes: 2 additions & 1 deletion test/mergely.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const defaultOptions = {
vpcolor: 'rgba(0, 0, 200, 0.5)',
license: 'lgpl',
cmsettings: {
styleSelectedText: true
styleSelectedText: true,
mode: null
},
_debug: false
};
Expand Down

0 comments on commit 827487a

Please sign in to comment.