MCPcopy Index your code
hub / github.com/witheve/Eve / posToDOM

Function posToDOM

src/codemirror.js:1876–1890  ·  view source on GitHub ↗
(cm, pos)

Source from the content-addressed store, hash-verified

1874 }, ContentEditableInput.prototype);
1875
1876 function posToDOM(cm, pos) {
1877 var view = findViewForLine(cm, pos.line);
1878 if (!view || view.hidden) return null;
1879 var line = getLine(cm.doc, pos.line);
1880 var info = mapFromLineView(view, line, pos.line);
1881
1882 var order = getOrder(line), side = "left";
1883 if (order) {
1884 var partPos = getBidiPartAt(order, pos.ch);
1885 side = partPos % 2 ? "right" : "left";
1886 }
1887 var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);
1888 result.offset = result.collapse == "right" ? result.end : result.start;
1889 return result;
1890 }
1891
1892 function badPos(pos, bad) { if (bad) pos.bad = true; return pos; }
1893

Callers 1

codemirror.jsFile · 0.85

Calls 6

findViewForLineFunction · 0.85
getLineFunction · 0.85
mapFromLineViewFunction · 0.85
getOrderFunction · 0.85
getBidiPartAtFunction · 0.85
nodeAndOffsetInLineMapFunction · 0.85

Tested by

no test coverage detected