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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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), 
Note: See TracChangeset for help on using the changeset viewer.

Sites map