mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-27 15:40:00 +00:00
2ad096a580
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 |
||
---|---|---|
.. | ||
ve.ui.CodeMirror.init.js | ||
ve.ui.CodeMirror.v6.less | ||
ve.ui.CodeMirrorAction.v6.js | ||
ve.ui.CodeMirrorTool.v6.js |