def eol_distance_last(self, offset=0):
        """Return the ammount of characters until the last newline."""
        distance = 0
        for char in reversed(self.string[:self.pos + offset]):
            if char == '\n':
                break
            else:
                distance += 1
        return distance
def eol_distance_last ( self , offset = 0 ) : distance = 0 for char in reversed ( self . string [ : self . pos + offset ] ) : if char == '\n' : break else : distance += 1 return distance
Return the ammount of characters until the last newline.