Dotclear


Ignore:
Timestamp:
06/24/19 13:04:56 (6 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Update Codemirror from 5.38.0 to 5.48.0

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

Legend:

Unmodified
Added
Removed
  • admin/js/codemirror/addon/display/fullscreen.js

    r3253 r3979  
    11// CodeMirror, copyright (c) by Marijn Haverbeke and others 
    2 // Distributed under an MIT license: http://codemirror.net/LICENSE 
     2// Distributed under an MIT license: https://codemirror.net/LICENSE 
    33 
    44(function(mod) { 
  • admin/js/codemirror/addon/edit/closebrackets.js

    r3758 r3979  
    11// CodeMirror, copyright (c) by Marijn Haverbeke and others 
    2 // Distributed under an MIT license: http://codemirror.net/LICENSE 
     2// Distributed under an MIT license: https://codemirror.net/LICENSE 
    33 
    44(function(mod) { 
     
    1212  var defaults = { 
    1313    pairs: "()[]{}''\"\"", 
     14    closeBefore: ")]}'\":;>", 
    1415    triples: "", 
    1516    explode: "[]{}" 
     
    110111    var pos = pairs.indexOf(ch); 
    111112    if (pos == -1) return CodeMirror.Pass; 
     113 
     114    var closeBefore = getOption(conf,"closeBefore"); 
     115 
    112116    var triples = getOption(conf, "triples"); 
    113117 
     
    137141        if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both"; 
    138142        else return CodeMirror.Pass; 
    139       } else if (opening && (cm.getLine(cur.line).length == cur.ch || 
    140                              isClosingBracket(next, pairs) || 
    141                              /\s/.test(next))) { 
     143      } else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) { 
    142144        curType = "both"; 
    143145      } else { 
     
    176178  } 
    177179 
    178   function isClosingBracket(ch, pairs) { 
    179     var pos = pairs.lastIndexOf(ch); 
    180     return pos > -1 && pos % 2 == 1; 
    181   } 
    182  
    183180  function charsAround(cm, pos) { 
    184181    var str = cm.getRange(Pos(pos.line, pos.ch - 1), 
  • admin/js/codemirror/addon/edit/matchbrackets.js

    r3758 r3979  
    11// CodeMirror, copyright (c) by Marijn Haverbeke and others 
    2 // Distributed under an MIT license: http://codemirror.net/LICENSE 
     2// Distributed under an MIT license: https://codemirror.net/LICENSE 
    33 
    44(function(mod) { 
     
    1515  var Pos = CodeMirror.Pos; 
    1616 
    17   var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; 
     17  var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<", "<": ">>", ">": "<<"}; 
     18 
     19  function bracketRegex(config) { 
     20    return config && config.bracketRegex || /[(){}[\]]/ 
     21  } 
    1822 
    1923  function findMatchingBracket(cm, where, config) { 
     
    2226    if (afterCursor == null) 
    2327      afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className) 
     28    var re = bracketRegex(config) 
    2429 
    2530    // A cursor is defined as between two characters, but in in vim command mode 
     
    2732    // highlighted box on top of the 2nd character. Otherwise, we allow matches 
    2833    // from before or after the cursor. 
    29     var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) || 
    30         matching[line.text.charAt(++pos)]; 
     34    var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) || 
     35        re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)]; 
    3136    if (!match) return null; 
    3237    var dir = match.charAt(1) == ">" ? 1 : -1; 
     
    5257 
    5358    var stack = []; 
    54     var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/; 
     59    var re = bracketRegex(config) 
    5560    var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) 
    5661                          : Math.max(cm.firstLine() - 1, where.line - maxScanLines); 
     
    6570        if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { 
    6671          var match = matching[ch]; 
    67           if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch); 
     72          if (match && (match.charAt(1) == ">") == (dir > 0)) stack.push(ch); 
    6873          else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; 
    6974          else stack.pop(); 
  • admin/js/codemirror/addon/mode/multiplex.js

    r3758 r3979  
    11// CodeMirror, copyright (c) by Marijn Haverbeke and others 
    2 // Distributed under an MIT license: http://codemirror.net/LICENSE 
     2// Distributed under an MIT license: https://codemirror.net/LICENSE 
    33 
    44(function(mod) { 
     
    5555            var outerIndent = 0; 
    5656            if (outer.indent) { 
    57               var possibleOuterIndent = outer.indent(state.outer, ""); 
     57              var possibleOuterIndent = outer.indent(state.outer, "", ""); 
    5858              if (possibleOuterIndent !== CodeMirror.Pass) outerIndent = possibleOuterIndent; 
    5959            } 
     
    9797    }, 
    9898 
    99     indent: function(state, textAfter) { 
     99    indent: function(state, textAfter, line) { 
    100100      var mode = state.innerActive ? state.innerActive.mode : outer; 
    101101      if (!mode.indent) return CodeMirror.Pass; 
    102       return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); 
     102      return mode.indent(state.innerActive ? state.inner : state.outer, textAfter, line); 
    103103    }, 
    104104 
     
    113113          if (other.open === "\n") { 
    114114            state.innerActive = other; 
    115             state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); 
     115            state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "", "") : 0); 
    116116          } 
    117117        } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map