MCPcopy
hub / github.com/antonmedv/codejar / beforeCursor

Function beforeCursor

codejar.ts:299–306  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297 }
298
299 function beforeCursor() {
300 const s = getSelection()
301 const r0 = s.getRangeAt(0)
302 const r = document.createRange()
303 r.selectNodeContents(editor)
304 r.setEnd(r0.startContainer, r0.startOffset)
305 return r.toString()
306 }
307
308 function afterCursor() {
309 const s = getSelection()

Callers 2

handleNewLineFunction · 0.85
handleTabCharactersFunction · 0.85

Calls 1

getSelectionFunction · 0.85

Tested by

no test coverage detected