From d6d8d06accaa4fa3a4352b95620e3e456226d444 Mon Sep 17 00:00:00 2001 From: Jamie Peabody Date: Sat, 15 Nov 2025 15:42:29 +0000 Subject: [PATCH] feat(#220): Exposes Mergely's instance of CodeMirror as Mergely.CodeMirror (#221) --- src/diff-view.js | 8 +++++--- src/mergely.js | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/diff-view.js b/src/diff-view.js index 94a24ee..82fdff4 100644 --- a/src/diff-view.js +++ b/src/diff-view.js @@ -18,9 +18,11 @@ function CodeMirrorDiffView(el, options) { const coords = this.cursorCoords(null, 'local'); this.scrollTo(null, (coords.top + coords.bottom) / 2 - (this.getScrollerElement().clientHeight / 2)); - }); - this.init(el, options); -}; + }); + this.init(el, options); + }; + +CodeMirrorDiffView.CodeMirror = CodeMirror; const trace = console.log; const traceTimeStart = console.time; diff --git a/src/mergely.js b/src/mergely.js index 44a1ed6..16bea09 100644 --- a/src/mergely.js +++ b/src/mergely.js @@ -253,6 +253,8 @@ class Mergely { } } +Mergely.CodeMirror = CodeMirrorDiffView.CodeMirror; + window.Mergely = Mergely; module.exports = Mergely;