MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / lineAt

Function lineAt

docs/components/editor.js:53–58  ·  view source on GitHub ↗
(text, caret)

Source from the content-addressed store, hash-verified

51 };
52
53 const lineAt = (text, caret) => {
54 const start = text.lastIndexOf('\n', caret - 1) + 1;
55 const nl = text.indexOf('\n', caret);
56 const end = nl === -1 ? text.length : nl;
57 return { start, end, body: text.slice(start, end), col: caret - start };
58 };
59 const firstNonWS = (s) => { for (let i = 0; i < s.length; i++) if (!WS.test(s[i])) return i; return s.length; };
60
61 // `prevIndentTabStop`, distance to the previous tab stop from `col`.

Callers 2

createEditorFunction · 0.85
copyPayloadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected