MCPcopy Create free account
hub / github.com/ajaxorg/ace / setDiffSession

Method setDiffSession

src/ext/diff/base_diff_view.js:202–220  ·  view source on GitHub ↗

* @param {{ sessionA: any; sessionB: EditSession; chunks: DiffChunk[] }} session

(session)

Source from the content-addressed store, hash-verified

200 * @param {{ sessionA: any; sessionB: EditSession; chunks: DiffChunk[] }} session
201 */
202 setDiffSession(session) {
203 if (this.diffSession) {
204 this.$detachSessionsEventHandlers();
205 this.clearSelectionMarkers();
206 }
207 this.diffSession = session;
208 this.sessionA = this.sessionB = null;
209 if (this.diffSession) {
210 this.chunks = this.diffSession.chunks || [];
211 this.editorA && this.editorA.setSession(session.sessionA);
212 this.editorB && this.editorB.setSession(session.sessionB);
213 this.sessionA = this.diffSession.sessionA;
214 this.sessionB = this.diffSession.sessionB;
215 this.$attachSessionsEventHandlers();
216 this.initSelectionMarkers();
217 }
218
219 this.otherSession = this.showSideA ? this.sessionB : this.sessionA;
220 }
221
222 /**
223 * @abstract

Callers 2

$setupModelsMethod · 0.95
diff_test.jsFile · 0.80

Calls 5

clearSelectionMarkersMethod · 0.95
initSelectionMarkersMethod · 0.95
setSessionMethod · 0.45

Tested by

no test coverage detected