From 271e17dd21f4f0c802a573b412e430998a70a78c 2012-07-27 20:38:56 From: Matthias BUSSONNIER Date: 2012-07-27 20:38:56 Subject: [PATCH] patch SingleOperator in CodeMirror2 --- 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 d6888e8..201da51 100644 --- a/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js +++ b/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js @@ -4,8 +4,11 @@ CodeMirror.defineMode("python", function(conf, parserConf) { function wordRegexp(words) { return new RegExp("^((" + words.join(")|(") + "))\\b"); } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); + + // IPython-specific changes: add '?' as recognized character. + var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]"); + // End IPython changes. + var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); var doubleOperators = new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");