force repaint of entire CM instance

How can I force CM to refresh the entire document (not only visible lines) in a way that will call renderLine on all lines ?
Thx!

editor.setOption("viewportMargin", Infinity)
editor.refresh()

Thx Marijn

There is still an efficiency issue … if I do:

function renderAll()
{
    var orgViewportMargin=editor.getOption("viewportMargin");
    editor.setOption("viewportMargin", Infinity);
    editor.refresh();
    editor.setOption("viewportMargin", orgViewportMargin);
}

and I put some log in renderLine, I see each line is being rendered 2 times and lines in view rendered 3 times. It would be useful to have a method to refresh CM in a way that will render each line only one time.
Thanks!

The refresh is in fact unnecessary – the option change handler for viewportMargin will itself ensure that the editor is refreshed. It isn’t currently smart enough to only refresh the parts that need to be refreshed, so you’ll have to live with the fact that the viewport gets redrawn twice, even without the refresh call. (It still sort of sounds like you’re doing something really strange here.)

ok thx got it - thx! I’ll remove the refresh.
I am working on exporting the content of CM to html. It seems like you think it’s a strange feature to have but to me (using CM for rich text editing as in Firepad) it is basic and essential.