eric6/HexEdit/HexEditChunks.py

changeset 8259
2bbec88047dd
parent 8207
d359172d11be
equal deleted inserted replaced
8258:82b608e352ec 8259:2bbec88047dd
299 """ 299 """
300 if pos < 0 or pos > self.__size: 300 if pos < 0 or pos > self.__size:
301 # position is out of range, do nothing 301 # position is out of range, do nothing
302 return False 302 return False
303 303
304 if pos == self.__size: 304 chunkIdx = (
305 chunkIdx = self.__getChunkIndex(pos - 1) 305 self.__getChunkIndex(pos - 1)
306 else: 306 if pos == self.__size else
307 chunkIdx = self.__getChunkIndex(pos) 307 self.__getChunkIndex(pos)
308 )
308 chunk = self.__chunks[chunkIdx] 309 chunk = self.__chunks[chunkIdx]
309 posInChunk = pos - chunk.absPos 310 posInChunk = pos - chunk.absPos
310 chunk.data.insert(posInChunk, data) 311 chunk.data.insert(posInChunk, data)
311 chunk.dataChanged.insert(posInChunk, 1) 312 chunk.dataChanged.insert(posInChunk, 1)
312 for idx in range(chunkIdx + 1, len(self.__chunks)): 313 for idx in range(chunkIdx + 1, len(self.__chunks)):

eric ide

mercurial