Skip to content

Commit 393a04d

Browse files
authored
Merge pull request #2066 from jupyter/cm-up
Patch CodeMirror 5.22
2 parents 5721d7c + 0e38b00 commit 393a04d

File tree

3 files changed

+9135
-1
lines changed

3 files changed

+9135
-1
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"backbone": "components/backbone#~1.2",
66
"bootstrap": "components/bootstrap#~3.3",
77
"bootstrap-tour": "0.9.0",
8-
"codemirror": "components/codemirror#~5.16",
8+
"codemirror": "components/codemirror#~5.22.2",
99
"es6-promise": "~1.0",
1010
"font-awesome": "components/font-awesome#~4.2.0",
1111
"google-caja": "5669",

setupbase.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,15 @@ def npm_components(self):
375375
shutil.rmtree(bower_pkg)
376376
shutil.copytree(npm_pkg, bower_pkg)
377377

378+
def patch_codemirror(self):
379+
"""Patch CodeMirror until https://github.com/codemirror/CodeMirror/issues/4454 is resolved"""
380+
381+
try:
382+
shutil.copyfile('tools/patches/codemirror.js', 'notebook/static/components/codemirror/lib/codemirror.js')
383+
except OSError as e:
384+
print("Failed to patch codemirror.js: %s" % e, file=sys.stderr)
385+
raise
386+
378387
def run(self):
379388
if not self.should_run():
380389
print("bower dependencies up to date")
@@ -398,6 +407,7 @@ def run(self):
398407
print("Failed to run bower: %s" % e, file=sys.stderr)
399408
print("You can install js dependencies with `npm install`", file=sys.stderr)
400409
raise
410+
self.patch_codemirror()
401411
self.npm_components()
402412
os.utime(self.bower_dir, None)
403413
# update package data in case this created new files

0 commit comments

Comments
 (0)