MCPcopy Index your code
hub / github.com/DHTMLX/gantt / lineStartSmart

Function lineStartSmart

samples/common/codehighlight/codemirror.js:7094–7104  ·  view source on GitHub ↗
(cm, pos)

Source from the content-addressed store, hash-verified

7092 return endOfLine(true, cm, line, lineN, -1)
7093 }
7094 function lineStartSmart(cm, pos) {
7095 var start = lineStart(cm, pos.line);
7096 var line = getLine(cm.doc, start.line);
7097 var order = getOrder(line, cm.doc.direction);
7098 if (!order || order[0].level == 0) {
7099 var firstNonWS = Math.max(start.ch, line.text.search(/\S/));
7100 var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;
7101 return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
7102 }
7103 return start
7104 }
7105
7106 // Run a handler that was bound to a key.
7107 function doHandleBinding(cm, bound, dropShift) {

Callers 1

codemirror.jsFile · 0.85

Calls 4

lineStartFunction · 0.85
getLineFunction · 0.85
getOrderFunction · 0.85
PosFunction · 0.85

Tested by

no test coverage detected