MCPcopy
hub / github.com/ajaxorg/ace / onInput

Method onInput

src/ext/diff/base_diff_view.js:270–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

268 });
269 }
270 onInput() {
271 if (this.$onInputTimer) clearTimeout(this.$onInputTimer);
272
273 var val1 = this.sessionA.doc.getAllLines();
274 var val2 = this.sessionB.doc.getAllLines();
275
276 this.selectionRangeA = null;
277 this.selectionRangeB = null;
278
279 var chunks = this.$diffLines(val1, val2);
280
281 this.diffSession.chunks = this.chunks = chunks;
282 this.gutterDecoratorA && this.gutterDecoratorA.setDecorations(chunks);
283 this.gutterDecoratorB && this.gutterDecoratorB.setDecorations(chunks);
284 // if we"re dealing with too many chunks, fail silently
285 if (this.chunks && this.chunks.length > this.$maxDiffs) {
286 return;
287 }
288
289 this.align();
290
291 this.editorA && this.editorA.renderer.updateBackMarkers();
292 this.editorB && this.editorB.renderer.updateBackMarkers();
293
294 setTimeout(() => {
295 this.updateScrollBarDecorators();
296 }, 0);
297
298 if (this.$foldUnchangedOnInput) {
299 this.foldUnchanged();
300 }
301 }
302
303 setupScrollbars() {
304 /**

Callers 3

scheduleOnInputMethod · 0.95
promptFunction · 0.45
diff_test.jsFile · 0.45

Calls 7

$diffLinesMethod · 0.95
alignMethod · 0.95
foldUnchangedMethod · 0.95
getAllLinesMethod · 0.80
setDecorationsMethod · 0.80
updateBackMarkersMethod · 0.80

Tested by

no test coverage detected