codemirror 3, thnaks Roberto Perdomo and Mariano Reingart
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<title>CodeMirror: Python mode</title>
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../../lib/util/matchbrackets.js"></script>
|
||||
<script src="python.js"></script>
|
||||
<link rel="stylesheet" href="../../doc/docs.css">
|
||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
|
||||
@@ -160,7 +160,7 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
|
||||
var singleline = delimiter.length == 1;
|
||||
var OUTCLASS = 'string';
|
||||
|
||||
return function tokenString(stream, state) {
|
||||
function tokenString(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
stream.eatWhile(/[^'"\\]/);
|
||||
if (stream.eat('\\')) {
|
||||
@@ -183,7 +183,9 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
|
||||
}
|
||||
}
|
||||
return OUTCLASS;
|
||||
};
|
||||
}
|
||||
tokenString.isString = true;
|
||||
return tokenString;
|
||||
}
|
||||
|
||||
function indent(stream, state, type) {
|
||||
@@ -323,9 +325,9 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
indent: function(state) {
|
||||
if (state.tokenize != tokenBase) {
|
||||
return 0;
|
||||
return state.tokenize.isString ? CodeMirror.Pass : 0;
|
||||
}
|
||||
|
||||
return state.scopes[0].offset;
|
||||
|
||||
Reference in New Issue
Block a user