QScintilla/QsciScintillaCompat.py

branch
Py2 comp.
changeset 2684
b1d8db9a31bc
parent 2677
3d4277929fb3
child 2791
a9577f248f04
equal deleted inserted replaced
2680:110ac646a3a0 2684:b1d8db9a31bc
245 @return raw character at the requested position or empty bytes, if the 245 @return raw character at the requested position or empty bytes, if the
246 position is negative or past the end of the document (bytes) 246 position is negative or past the end of the document (bytes)
247 """ 247 """
248 char = self.SendScintilla(QsciScintilla.SCI_GETCHARAT, pos) 248 char = self.SendScintilla(QsciScintilla.SCI_GETCHARAT, pos)
249 if char == 0: 249 if char == 0:
250 return b"" 250 return bytearray()
251 if char < 0: 251 if char < 0:
252 char += 256 252 char += 256
253 return bytes.fromhex("{0:02x}".format(char)) 253 return bytearray((char,))
254 254
255 def foldLevelAt(self, line): 255 def foldLevelAt(self, line):
256 """ 256 """
257 Public method to get the fold level of a line of the document. 257 Public method to get the fold level of a line of the document.
258 258

eric ide

mercurial