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

Function gutterEvent

tools/pythonauto/static/codemirror/codemirror.js:1867–1888  ·  view source on GitHub ↗
(cm, e, type, prevent, signalfn)

Source from the content-addressed store, hash-verified

1865 }
1866
1867 function gutterEvent(cm, e, type, prevent, signalfn) {
1868 try { var mX = e.clientX, mY = e.clientY; }
1869 catch(e) { return false; }
1870 if (mX >= Math.floor(getRect(cm.display.gutters).right)) return false;
1871 if (prevent) e_preventDefault(e);
1872
1873 var display = cm.display;
1874 var lineBox = getRect(display.lineDiv);
1875
1876 if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e);
1877 mY -= lineBox.top - display.viewOffset;
1878
1879 for (var i = 0; i < cm.options.gutters.length; ++i) {
1880 var g = display.gutters.childNodes[i];
1881 if (g && getRect(g).right >= mX) {
1882 var line = lineAtHeight(cm.doc, mY);
1883 var gutter = cm.options.gutters[i];
1884 signalfn(cm, type, cm, line, gutter, e);
1885 return e_defaultPrevented(e);
1886 }
1887 }
1888 }
1889
1890 function contextMenuInGutter(cm, e) {
1891 if (!hasHandler(cm, "gutterContextMenu")) return false;

Callers 2

contextMenuInGutterFunction · 0.70
clickInGutterFunction · 0.70

Calls 5

getRectFunction · 0.85
e_preventDefaultFunction · 0.70
hasHandlerFunction · 0.70
e_defaultPreventedFunction · 0.70
lineAtHeightFunction · 0.70

Tested by

no test coverage detected