Change:
I notice that when I edit our 1.9 release notes, the markdown preview seems to jump up and down all the time there is a change. Compared to 1.8 stable, this seemed to not happen.
Better, I still see flickering that it jumps up and down a little bit and the decoration to the left to show me the current edited location is also flickering. let me know if I should open a separate issue on that or if you think that is fixable.
The flicker should now be better than VSCode 1.8, but we can still do better. I've noticed the same sort of slight flicker on images in particular and on the current paragraph indicator as you noted. Please open another, lower priority issue so that we can track further improvements Thanks

Discussion:
window.onload = () => { if (window.initialData.scrollPreviewWithEditorSelection) { <del> const initialLine = +window.initialData.line || 0; setTimeout(() => { scrollDisabled = true; scrollToRevealSourceLine(initialLine); }, 0); </del> <ins> const initialLine = +window.initialData.line; if (!isNaN(initialLine)) { setTimeout(() => { scrollDisabled = true; scrollToRevealSourceLine(initialLine); }, 0); } </ins> } };

}; function getTarget() { <del> return document.getElementById('_target'); </del> <ins> return document.getElementById('_target');; </ins> }; const ipcRenderer = require('electron').ipcRenderer;

newDocument.body.appendChild(defaultScripts); styleBody(newDocument.body); <ins> const frame = getTarget(); frame.setAttribute('id', '_oldTarget') </ins> // keep current scrollTop around and use later <del> const scrollTop = getTarget().contentDocument.body.scrollTop; </del> <ins> const scrollTop = frame.contentDocument.body.scrollTop; const newFrame = document.createElement('iframe'); newFrame.setAttribute('id', '_target'); newFrame.setAttribute('frameborder', '0'); newFrame.style.cssText = "margin: 0; overflow: hidden; position: absolute; width: 100%; height: 100%; display: none"; document.body.appendChild(newFrame); </ins> // write new content onto iframe <del> getTarget().contentDocument.open('text/html', 'replace'); </del> <ins> newFrame.contentDocument.open('text/html', 'replace'); </ins> // set DOCTYPE for newDocument explicitly as DOMParser.parseFromString strips it off // and DOCTYPE is needed in the iframe to ensure that the user agent stylesheet is correctly overridden <del> getTarget().contentDocument.write('<!DOCTYPE html>'); getTarget().contentDocument.write(newDocument.documentElement.innerHTML); getTarget().contentDocument.close(); </del> <ins> newFrame.contentDocument.write('<!DOCTYPE html>'); newFrame.contentDocument.write(newDocument.documentElement.innerHTML); newFrame.contentDocument.close(); </ins> // workaround for https://github.com/Microsoft/vscode/issues/12865 // check new scrollTop and reset if neccessary <del> setTimeout(function () { if (scrollTop !== getTarget().contentDocument.body.scrollTop) { getTarget().contentDocument.body.scrollTop = scrollTop; </del> <ins> setTimeout(() => { if (scrollTop !== newFrame.contentDocument.body.scrollTop) { newFrame.contentDocument.body.scrollTop = scrollTop; </ins> } <ins> document.body.removeChild(frame); newFrame.style.display = 'block'; </ins> }, 0); ipcRenderer.sendToHost('did-set-content', stats);