MCPcopy Index your code
hub / github.com/csev/py4e / cursorCoords

Function cursorCoords

tools/pythonauto/static/codemirror/codemirror.js:1221–1249  ·  view source on GitHub ↗
(cm, pos, context, lineObj, measurement)

Source from the content-addressed store, hash-verified

1219 }
1220
1221 function cursorCoords(cm, pos, context, lineObj, measurement) {
1222 lineObj = lineObj || getLine(cm.doc, pos.line);
1223 if (!measurement) measurement = measureLine(cm, lineObj);
1224 function get(ch, right) {
1225 var m = measureChar(cm, lineObj, ch, measurement, right ? "right" : "left");
1226 if (right) m.left = m.right; else m.right = m.left;
1227 return intoCoordSystem(cm, lineObj, m, context);
1228 }
1229 function getBidi(ch, partPos) {
1230 var part = order[partPos], right = part.level % 2;
1231 if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
1232 part = order[--partPos];
1233 ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
1234 right = true;
1235 } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
1236 part = order[++partPos];
1237 ch = bidiLeft(part) - part.level % 2;
1238 right = false;
1239 }
1240 if (right && ch == part.to && ch > part.from) return get(ch - 1);
1241 return get(ch, right);
1242 }
1243 var order = getOrder(lineObj), ch = pos.ch;
1244 if (!order) return get(ch);
1245 var partPos = getBidiPartAt(order, ch);
1246 var val = getBidi(ch, partPos);
1247 if (bidiOther != null) val.other = getBidi(ch, bidiOther);
1248 return val;
1249 }
1250
1251 function PosWithInfo(line, ch, outside, xRel) {
1252 var pos = new Pos(line, ch);

Callers 6

updateSelectionFunction · 0.70
updateSelectionCursorFunction · 0.70
getXFunction · 0.70
endOperationFunction · 0.70
scrollPosIntoViewFunction · 0.70
codemirror.jsFile · 0.70

Calls 6

getLineFunction · 0.70
measureLineFunction · 0.70
getOrderFunction · 0.70
getFunction · 0.70
getBidiPartAtFunction · 0.70
getBidiFunction · 0.70

Tested by

no test coverage detected