MCPcopy Create free account
hub / github.com/TruthHun/BookStack / findBreakPoint

Function findBreakPoint

static/editor.md/lib/codemirror/addon/wrap/hardwrap.js:32–40  ·  view source on GitHub ↗
(text, column, wrapOn, killTrailingSpace)

Source from the content-addressed store, hash-verified

30 }
31
32 function findBreakPoint(text, column, wrapOn, killTrailingSpace) {
33 for (var at = column; at > 0; --at)
34 if (wrapOn.test(text.slice(at - 1, at + 1))) break;
35 if (at == 0) at = column;
36 var endOfText = at;
37 if (killTrailingSpace)
38 while (text.charAt(endOfText - 1) == " ") --endOfText;
39 return {from: endOfText, to: at};
40 }
41
42 function wrapRange(cm, from, to, options) {
43 from = cm.clipPos(from); to = cm.clipPos(to);

Callers 1

wrapRangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected