In a simple mode, a pattern is only supposed to dedent the line that it is on if it’s the first pattern in that line, correct? This doesn’t appear to be happening in some cases. I believe it fails when a dedent pattern immediately follows the first pattern on the line.
See here for an example using just the demo simple mode: http://jsfiddle.net/nn115zws/2/
I was able to correct this behavior by modifying indentFunction
(around https://github.com/codemirror/CodeMirror/blob/b35c14c68a41e4d09f685726636d64af6349094c/addon/mode/simple.js#L199) to only continue scanning if the matched rule dedented. If this is in fact a bug, I’m happy to open a PR. Just wanted to make sure I correctly understood the intended behavior first.