mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 22:03:28 +00:00
0506a10eab
The 2017 editor has an infinite viewport, meaning the entire document is
printed on page load. CodeMirror 6 meanwhile only processes text in the
visible viewport. This presents a situation where if large chunks of
text are inserted outside the visible range (such as the "Changes
recovered" feature of VE), it can cause misalignment of the VE surface
and visible CodeMirror layer, as CodeMirror has not accounted for the
off-screen lines of text.
CodeMirror 5 had a `viewportMargin: infinity` option that prevented this
issue, but at the cost of performance. CodeMirror 6 removed this option,
but the same effect can be achieved by tricking CodeMirror into thinking
we're printing the document, in which case it will process all lines.
This seriously hurts performance, and is a nasty hack, but until the
2017 editor is reworked to have a viewport, there may be no other means
to prevent the misalignment.
The discovery of this issue and the fix are courtesy of Fandom engineers
Bug: T357482
Change-Id: If11ce48459e8faf55015108e8c2eabdc16e0d917
(cherry picked from commit
|
||
---|---|---|
.. | ||
legacy | ||
lib | ||
ve-cm | ||
.eslintrc.json | ||
codemirror.bundle.js | ||
codemirror.js | ||
codemirror.less | ||
codemirror.mediawiki.bidiIsolation.js | ||
codemirror.mediawiki.colorblind.less | ||
codemirror.mediawiki.config.js | ||
codemirror.mediawiki.init.js | ||
codemirror.mediawiki.js | ||
codemirror.mediawiki.less | ||
codemirror.mediawiki.templateFolding.js | ||
codemirror.textSelection.js | ||
codemirror.wikieditor.js | ||
codemirror.wikieditor.mediawiki.init.js |