MCPcopy
hub / github.com/hokein/electron-sample-apps / copyState

Function copyState

mini-code-editor/cm/lib/codemirror.js:2165–2175  ·  view source on GitHub ↗
(mode, state)

Source from the content-addressed store, hash-verified

2163 // Utility functions for working with state. Exported because modes
2164 // sometimes need to do this.
2165 function copyState(mode, state) {
2166 if (state === true) return state;
2167 if (mode.copyState) return mode.copyState(state);
2168 var nstate = {};
2169 for (var n in state) {
2170 var val = state[n];
2171 if (val instanceof Array) val = val.concat([]);
2172 nstate[n] = val;
2173 }
2174 return nstate;
2175 }
2176 CodeMirror.copyState = copyState;
2177 function startState(mode, a1, a2) {
2178 return mode.startState ? mode.startState(a1, a2) : true;

Callers 3

getStateBeforeFunction · 0.85
highlightLinesFunction · 0.85
highlightWorkerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected