As a a rule there are different fonts in use in the two windows so they will not match. Of course they could be changed to match, however wikitext as simple as a heading or list widgets will quickly throw it all out again. You could look for one of the wysiwig solutions and use one pane.
The best general solution I have considered, but not built, is to use codemirror to add line numbers to the editor and build a special preview that places line numbers in a left hand column in the preview, with the naturally un-numbered lines (eg the result of a list widget) just blank. We could use the line number in codemirror to automatically scroll the preview window to its matching line.