diff options
Diffstat (limited to 'assets/js/codemirror/addon/mode/overlay.js')
-rw-r--r-- | assets/js/codemirror/addon/mode/overlay.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/assets/js/codemirror/addon/mode/overlay.js b/assets/js/codemirror/addon/mode/overlay.js index e1b9ed37..839d9e55 100644 --- a/assets/js/codemirror/addon/mode/overlay.js +++ b/assets/js/codemirror/addon/mode/overlay.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE // Utility function that allows modes to be combined. The mode given // as the base argument takes care of most of the normal mode @@ -76,8 +76,13 @@ CodeMirror.overlayMode = function(base, overlay, combine) { innerMode: function(state) { return {state: state.base, mode: base}; }, blankLine: function(state) { - if (base.blankLine) base.blankLine(state.base); - if (overlay.blankLine) overlay.blankLine(state.overlay); + var baseToken, overlayToken; + if (base.blankLine) baseToken = base.blankLine(state.base); + if (overlay.blankLine) overlayToken = overlay.blankLine(state.overlay); + + return overlayToken == null ? + baseToken : + (combine && baseToken != null ? baseToken + " " + overlayToken : overlayToken); } }; }; |