E5XML/SessionReader.py

changeset 938
f421f2138c0f
parent 791
9ec2ac20e54e
child 945
8cd4d08fa9f6
equal deleted inserted replaced
937:336c8f1ee7bb 938:f421f2138c0f
103 if self.name() == "Filename": 103 if self.name() == "Filename":
104 cline = int(self.attribute("cline", "0")) 104 cline = int(self.attribute("cline", "0"))
105 cindex = int(self.attribute("cindex", "0")) 105 cindex = int(self.attribute("cindex", "0"))
106 folds = self.attribute("folds") 106 folds = self.attribute("folds")
107 if folds: 107 if folds:
108 folds = [int(f) for f in folds.split(',')] 108 folds = [int(f) - 1 for f in folds.split(',')]
109 else: 109 else:
110 folds = [] 110 folds = []
111 zoom = int(self.attribute("zoom", "-9999")) 111 zoom = int(self.attribute("zoom", "-9999"))
112 filename = self.readElementText() 112 filename = self.readElementText()
113 113
116 if ed is not None: 116 if ed is not None:
117 if zoom > -9999: 117 if zoom > -9999:
118 ed.zoomTo(zoom) 118 ed.zoomTo(zoom)
119 if folds: 119 if folds:
120 ed.recolor() 120 ed.recolor()
121 for line in folds: 121 ed.setContractedFolds(folds)
122 ed.foldLine(line - 1)
123 ed.setCursorPosition(cline, cindex) 122 ed.setCursorPosition(cline, cindex)
124 ed.ensureCursorVisible() 123 ed.ensureCursorVisible()
125 else: 124 else:
126 self.raiseUnexpectedStartTag(self.name()) 125 self.raiseUnexpectedStartTag(self.name())
127 126

eric ide

mercurial