For example, in the following image, all = after >, <, = are black, and operators +=, -=, *=, /= are not recognized.
There is something wrong in the CodeMirror mode, here is the doubleOperators define in python.js:
var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/;
There is a bug in it for !=, <=, >=, == operators, it should be:
var doubleOperators = parserConf.doubleOperators || /^([!<>=]=|<>|<<|>>|\/\/|\*\*)/;
and I thinks operators in doubleDelimiters should be appended to doubleOperators.
Here is the code I added to codemirror-ipython.js:
pythonConf.doubleOperators = /^([!<>=]=|<>|<<|>>|\/\/|\*\*|\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
pythonConf.doubleDelimiters = /^(@@)/; // I don't know how to remove all items in doubleDelimiters
Here is the result (I am using programming ligatures):
It looks like we currently inherit the doubleOperators from CodeMirror, without overriding it. So I think it would be best to fix this in CodeMirror, if you have the time to file an issue there.
For example, in the following image, all
=
after>, <, =
are black, and operators+=, -=, *=, /=
are not recognized.There is something wrong in the CodeMirror mode, here is the
doubleOperators
define inpython.js
:There is a bug in it for
!=, <=, >=, ==
operators, it should be:and I thinks operators in
doubleDelimiters
should be appended todoubleOperators
.Here is the code I added to
codemirror-ipython.js
:Here is the result (I am using programming ligatures):