Lines Matching refs:data
97 The mock's data model is that a text is a list of \n-terminated lines.
113 self.data = ['', '\n']
120 """Return a (line, char) tuple of int indexes into self.data.
124 self.data. For many indexes, the result is initially (1, 0).
142 lastline = len(self.data) - 1 # same as number of text lines
144 return lastline, len(self.data[lastline]) - 1
157 linelength = len(self.data[line]) -1 # position before/at \n
179 n = len(self.data)
184 return n, len(self.data[n]) + endflag
195 before = self.data[line][:char]
196 after = self.data[line][char:]
197 self.data[line] = before + chars[0]
198 self.data[line+1:line+1] = chars[1:]
199 self.data[line+len(chars)-1] += after
211 return self.data[startline][startchar:endchar]
213 lines = [self.data[startline][startchar:]]
215 lines.append(self.data[i])
216 lines.append(self.data[endline][:endchar])
223 Do not delete the terminal \n at the very end of self.data ([-1][-1]).
227 if startchar < len(self.data[startline])-1:
230 elif startline < len(self.data) - 1:
241 self.data[startline] = self.data[startline][:startchar] + \
242 self.data[startline][endchar:]
244 self.data[startline] = self.data[startline][:startchar] + \
245 self.data[endline][endchar:]
248 del self.data[startline]