MCPcopy Create free account
hub / github.com/TruthHun/BookStack / lastChangeEvent

Function lastChangeEvent

static/mergely/lib/codemirror.js:7904–7914  ·  view source on GitHub ↗
(hist, force)

Source from the content-addressed store, hash-verified

7902 // Find the top change event in the history. Pop off selection
7903 // events that are in the way.
7904 function lastChangeEvent(hist, force) {
7905 if (force) {
7906 clearSelectionEvents(hist.done);
7907 return lst(hist.done);
7908 } else if (hist.done.length && !lst(hist.done).ranges) {
7909 return lst(hist.done);
7910 } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {
7911 hist.done.pop();
7912 return lst(hist.done);
7913 }
7914 }
7915
7916 // Register a change in the history. Merges changes that are within
7917 // a single operation, ore are close together with an origin that

Callers 1

addChangeToHistoryFunction · 0.70

Calls 2

clearSelectionEventsFunction · 0.70
lstFunction · 0.70

Tested by

no test coverage detected