MCPcopy Index your code
hub / github.com/DHTMLX/gantt / filterSelectionChange

Function filterSelectionChange

samples/common/codehighlight/codemirror.js:5080–5095  ·  view source on GitHub ↗
(doc, sel, options)

Source from the content-addressed store, hash-verified

5078 // Give beforeSelectionChange handlers a change to influence a
5079 // selection update.
5080 function filterSelectionChange(doc, sel, options) {
5081 var obj = {
5082 ranges: sel.ranges,
5083 update: function(ranges) {
5084 this.ranges = [];
5085 for (var i = 0; i < ranges.length; i++)
5086 { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
5087 clipPos(doc, ranges[i].head)); }
5088 },
5089 origin: options && options.origin
5090 };
5091 signal(doc, "beforeSelectionChange", doc, obj);
5092 if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); }
5093 if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }
5094 else { return sel }
5095 }
5096
5097 function setSelectionReplaceHistory(doc, sel, options) {
5098 var done = doc.history.done, last = lst(done);

Callers 1

setSelectionNoUndoFunction · 0.85

Calls 3

clipPosFunction · 0.85
signalFunction · 0.85
normalizeSelectionFunction · 0.85

Tested by

no test coverage detected