1. A method comprising: displaying, with an online document editing system, a visual representation of an electronic document; receiving an input to affect a modification of the electronic document, the modification comprising two or more document change operations; causing each of the two or more document change operations to be applied to the electronic document; determining, using the online document editing system, a redraw approach for redrawing a portion of the visual representation of the electronic document based on the two or more document change operations, the redraw approach comprising fewer redraws than document change operations; performing a first redraw of the portion of the visual representation of the electronic document based on the redraw approach; tracking all document change operations including the two or more document change operations; receiving undo commands to undo a portion of all of the document change operations after the performing a first redraw, wherein the portion of all of the document change operations is less than all of the document change operations; and performing a second redraw of a portion of the visual representation of the electronic document to implement the undo commands by applying merging rules to reverse a portion of the document change operations, wherein the merging rules provide fewer redraws than the number of undo commands.