mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 07:24:21 +00:00

see http://forum.fhem.de/index.php/topic,20444.0.html *** may be deleted at any time! *** *** will not be delivered via update until official release *** git-svn-id: https://svn.fhem.de/fhem/trunk@5131 2b470e98-0d58-463d-a4d8-8e2adae1ed80
16 lines
528 B
JavaScript
16 lines
528 B
JavaScript
CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
|
|
if (prev == CodeMirror.Init) prev = false;
|
|
if (prev && !val)
|
|
cm.removeOverlay("trailingspace");
|
|
else if (!prev && val)
|
|
cm.addOverlay({
|
|
token: function(stream) {
|
|
for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
|
|
if (i > stream.pos) { stream.pos = i; return null; }
|
|
stream.pos = l;
|
|
return "trailingspace";
|
|
},
|
|
name: "trailingspace"
|
|
});
|
|
});
|