Skip to content

Commit

Permalink
Merge pull request ipython#1303 from ellisonbg/updatecm
Browse files Browse the repository at this point in the history
This updates CodeMirror and refactors a good bit of the notebook code related to it.

* Updated CodeMirror to the latest stable release.
* Fix numerous bugs related to the CM update.
* Refactored the Cell API and the notebook's cell handling methods.
* Generalized split/merge to work with all cell types.
* Generalized "Edit in Ace" to work with all cell types.
* Loading optimizations: pager starts out hidden, faster loads.
* Shading added to Markdown and HTML cells when they are being edited.
* This branch will require solid usability testing on Safari, FF and Chrome before merging.
* Fixed a number of CM related bugs.
  • Loading branch information
ellisonbg committed Jan 24, 2012
2 parents 5dc633b + e3f0934 commit 89c8576
Show file tree
Hide file tree
Showing 51 changed files with 3,084 additions and 1,533 deletions.
1 change: 1 addition & 0 deletions IPython/frontend/html/notebook/static/ace/mode-html.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions IPython/frontend/html/notebook/static/ace/mode-markdown.js

Large diffs are not rendered by default.

Expand Up @@ -5,7 +5,7 @@
We carry a mostly unmodified copy of CodeMirror. The current version we use
is (*please update this information when updating versions*)::

CodeMirror 2.15
CodeMirror 2.2

The only changes we've applied so far are these::

Expand Down
2 changes: 1 addition & 1 deletion IPython/frontend/html/notebook/static/codemirror/README.md
Expand Up @@ -2,5 +2,5 @@

CodeMirror 2 is a rewrite of [CodeMirror
1](http://github.com/marijnh/CodeMirror). The docs live
[here](http://codemirror.net/manual.html), and the project page is
[here](http://codemirror.net/doc/manual.html), and the project page is
[http://codemirror.net/](http://codemirror.net/).
64 changes: 50 additions & 14 deletions IPython/frontend/html/notebook/static/codemirror/lib/codemirror.css
Expand Up @@ -23,6 +23,7 @@
color: #aaa;
text-align: right;
padding: .4em .2em .4em .4em;
white-space: pre !important;
}
.CodeMirror-lines {
padding: .4em;
Expand All @@ -41,28 +42,63 @@
word-wrap: normal;
}

.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}

.CodeMirror textarea {
font-family: inherit !important;
font-size: inherit !important;
outline: none !important;
}

.CodeMirror-cursor {
.CodeMirror pre.CodeMirror-cursor {
z-index: 10;
position: absolute;
visibility: hidden;
border-left: 1px solid black !important;
border-left: 1px solid black;
}
.CodeMirror-focused .CodeMirror-cursor {
.CodeMirror-focused pre.CodeMirror-cursor {
visibility: visible;
}

span.CodeMirror-selected {
background: #ccc !important;
color: HighlightText !important;
}
.CodeMirror-focused span.CodeMirror-selected {
background: Highlight !important;
}
span.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused span.CodeMirror-selected { background: #d2dcf8; }

.CodeMirror-searching {background: #ffa;}

/* Default theme */

.cm-s-default span.cm-keyword {color: #708;}
.cm-s-default span.cm-atom {color: #219;}
.cm-s-default span.cm-number {color: #164;}
.cm-s-default span.cm-def {color: #00f;}
.cm-s-default span.cm-variable {color: black;}
.cm-s-default span.cm-variable-2 {color: #05a;}
.cm-s-default span.cm-variable-3 {color: #085;}
.cm-s-default span.cm-property {color: black;}
.cm-s-default span.cm-operator {color: black;}
.cm-s-default span.cm-comment {color: #a50;}
.cm-s-default span.cm-string {color: #a11;}
.cm-s-default span.cm-string-2 {color: #f50;}
.cm-s-default span.cm-meta {color: #555;}
.cm-s-default span.cm-error {color: #f00;}
.cm-s-default span.cm-qualifier {color: #555;}
.cm-s-default span.cm-builtin {color: #30a;}
.cm-s-default span.cm-bracket {color: #cc7;}
.cm-s-default span.cm-tag {color: #170;}
.cm-s-default span.cm-attribute {color: #00c;}
.cm-s-default span.cm-header {color: #a0a;}
.cm-s-default span.cm-quote {color: #090;}
.cm-s-default span.cm-hr {color: #999;}
.cm-s-default span.cm-link {color: #00c;}

span.cm-header, span.cm-strong {font-weight: bold;}
span.cm-em {font-style: italic;}
span.cm-emstrong {font-style: italic; font-weight: bold;}
span.cm-link {text-decoration: underline;}

.CodeMirror-matchingbracket {color: #0f0 !important;}
.CodeMirror-nonmatchingbracket {color: #f22 !important;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}

0 comments on commit 89c8576

Please sign in to comment.