Skip to content
Snippets Groups Projects
Commit b9ddf1d4 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[python mode] Don't prescribe indentation for multi-line strings

parent 1ba5c8d6
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......@@ -325,7 +327,7 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
indent: function(state) {
if (state.tokenize != tokenBase) {
return 0;
return state.tokenize.isString ? CodeMirror.Pass : 0;
}
return state.scopes[0].offset;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment