From c0fb925d332fc36d879d75f00cceb15f27959973 2011-10-14 03:01:34 From: Fernando Perez Date: 2011-10-14 03:01:34 Subject: [PATCH] Add a README with version and ipython-specific changes info. --- diff --git a/IPython/frontend/html/notebook/static/codemirror/README-IPython.rst b/IPython/frontend/html/notebook/static/codemirror/README-IPython.rst new file mode 100644 index 0000000..aea3d76 --- /dev/null +++ b/IPython/frontend/html/notebook/static/codemirror/README-IPython.rst @@ -0,0 +1,33 @@ +======================= + CodeMirror in IPython +======================= + +We carry a mostly unmodified copy of CodeMirror. The current version we use +is (*please update this information when updating versions*):: + + CodeMirror 2.15 + +The only changes we've applied so far are these:: + + diff --git a/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js b/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js + index ca94e7a..fc9a503 100644 + --- a/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js + +++ b/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js + @@ -5,7 +5,11 @@ CodeMirror.defineMode("python", function(conf, parserConf) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + - var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); + + // IPython-specific changes: add '?' as recognized character. + + //var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); + + var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]"); + + // End IPython changes. + + + var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); + var doubleOperators = new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); + var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); + + +In practice it's just a one-line change, adding `\\?` to singleOperators, +surrounded by a comment. We'll turn this into a proper patchset if it ever +gets more complicated than this, but for now this note should be enough. diff --git a/IPython/frontend/html/notebook/static/codemirror/ipython-version-2.15 b/IPython/frontend/html/notebook/static/codemirror/ipython-version-2.15 deleted file mode 100644 index e69de29..0000000 --- a/IPython/frontend/html/notebook/static/codemirror/ipython-version-2.15 +++ /dev/null