Dotclear


Ignore:
Timestamp:
06/13/18 12:31:58 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Update Codemirror to 5.38.0

Location:
admin/js/codemirror/addon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • admin/js/codemirror/addon/edit/closebrackets.js

    r3617 r3758  
    130130          curType = "skip"; 
    131131      } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && 
    132                  cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch && 
    133                  (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) { 
     132                 cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) { 
     133        if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass; 
    134134        curType = "addFour"; 
    135135      } else if (identical) { 
  • admin/js/codemirror/addon/edit/matchbrackets.js

    r3617 r3758  
    103103  } 
    104104 
    105   var currentlyHighlighted = null; 
    106105  function doMatchBrackets(cm) { 
    107106    cm.operation(function() { 
    108       if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} 
    109       currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); 
     107      if (cm.state.matchBrackets.currentlyHighlighted) { 
     108        cm.state.matchBrackets.currentlyHighlighted(); 
     109        cm.state.matchBrackets.currentlyHighlighted = null; 
     110      } 
     111      cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); 
    110112    }); 
    111113  } 
     
    114116    if (old && old != CodeMirror.Init) { 
    115117      cm.off("cursorActivity", doMatchBrackets); 
    116       if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} 
     118      if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) { 
     119        cm.state.matchBrackets.currentlyHighlighted(); 
     120        cm.state.matchBrackets.currentlyHighlighted = null; 
     121      } 
    117122    } 
    118123    if (val) { 
  • admin/js/codemirror/addon/mode/multiplex.js

    r3251 r3758  
    5151            if (!other.parseDelimiters) stream.match(other.open); 
    5252            state.innerActive = other; 
    53             state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); 
     53 
     54            // Get the outer indent, making sure to handle CodeMirror.Pass 
     55            var outerIndent = 0; 
     56            if (outer.indent) { 
     57              var possibleOuterIndent = outer.indent(state.outer, ""); 
     58              if (possibleOuterIndent !== CodeMirror.Pass) outerIndent = possibleOuterIndent; 
     59            } 
     60 
     61            state.inner = CodeMirror.startState(other.mode, outerIndent); 
    5462            return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open"); 
    5563          } else if (found != -1 && found < cutOff) { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map