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

Function extendSelections

lib/web/CodeMirror/src/model/selection_updates.js:45–52  ·  view source on GitHub ↗
(doc, heads, options)

Source from the content-addressed store, hash-verified

43// Extend all selections (pos is an array of selections with length
44// equal the number of selections)
45export function extendSelections(doc, heads, options) {
46 let out = []
47 let extend = doc.cm && (doc.cm.display.shift || doc.extend)
48 for (let i = 0; i < doc.sel.ranges.length; i++)
49 out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend)
50 let newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex)
51 setSelection(doc, newSel, options)
52}
53
54// Updates a single range in the selection.
55export function replaceOneSelection(doc, i, range, options) {

Callers 1

Doc.jsFile · 0.90

Calls 3

normalizeSelectionFunction · 0.90
extendRangeFunction · 0.70
setSelectionFunction · 0.70

Tested by

no test coverage detected