CodeMirror
Home Manual Code
Automatically derive odd wrapping behavior for your browser
Automatically derive odd wrapping behavior for your browser
This is a hack to automatically derive a spanAffectsWrapping regexp for a browser. See the comments above that variable in lib/codemirror.js for some more details.
var a = document.getElementById("area"), bad = Object.create(null); var chars = "a~`!@#$%^&*()-_=+}{[]\|'\"/?.>, 1) { var invert = false; if (str.length > chars.length * .6) { invert = true; var newStr = ""; for (var i = 0; i