MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / wrapX

Function wrapX

lib/web/CodeMirror/src/display/selection.js:77–82  ·  view source on GitHub ↗
(pos, dir, side)

Source from the content-addressed store, hash-verified

75 }
76
77 function wrapX(pos, dir, side) {
78 let extent = wrappedLineExtentChar(cm, lineObj, null, pos)
79 let prop = (dir == "ltr") == (side == "after") ? "left" : "right"
80 let ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1)
81 return coords(ch, prop)[prop]
82 }
83
84 let order = getOrder(lineObj, doc.direction)
85 iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, (from, to, dir, i) => {

Callers 1

drawForLineFunction · 0.70

Calls 3

wrappedLineExtentCharFunction · 0.90
coordsFunction · 0.70
testMethod · 0.45

Tested by

no test coverage detected