TextViewer.py
changeset 684 f10449b18dbe
parent 675 0ea836add01f
child 687 629680fb0582
--- a/TextViewer.py	Sat May 12 12:33:17 2012 +0200
+++ b/TextViewer.py	Fri May 18 18:49:49 2012 +0200
@@ -247,7 +247,7 @@
         return {"cursor_pos": self.Editor.GetCurrentPos()}
     
     def SetState(self, state):
-        self.Editor.GotoPos(state["cursor_pos"])
+        self.Editor.GotoPos(state.get("cursor_pos", 0))
         
     def OnModification(self, event):
         if not self.DisableEvents: