Skip to content

Commit

Permalink
Upgrade CodeMirror
Browse files Browse the repository at this point in the history
closes #2108

- upgrade to 4.0.1
- requires removing the deprecated setLine method
  • Loading branch information
ErisDS committed Mar 17, 2014
1 parent 80bdfd7 commit 6d3cd84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bower.json
Expand Up @@ -2,7 +2,7 @@
"name": "ghost",
"dependencies": {
"backbone": "1.0.0",
"codemirror": "3.15.0",
"codemirror": "4.0.1",
"Countable": "2.0.2",
"fastclick": "1.0.0",
"ghost-ui": "0.1.2",
Expand Down
11 changes: 9 additions & 2 deletions core/client/assets/lib/editor/markerManager.js
Expand Up @@ -45,8 +45,15 @@
// ln - line number
addMarker = function (line, ln) {
var marker,
magicId = '{<' + uploadId + '>}';
editor.setLine(ln, magicId + line.text);
magicId = '{<' + uploadId + '>}',
newText = magicId + line.text;

editor.replaceRange(
newText,
{line: ln, ch: 0},
{line: ln, ch: newText.length}
);

marker = editor.markText(
{line: ln, ch: 0},
{line: ln, ch: (magicId.length)},
Expand Down

0 comments on commit 6d3cd84

Please sign in to comment.