<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend_right_to(self, window, max_size):
 """Adjust the size to make our window end where the right window begins, but don't get larger than max_size"""

        self.size = min(self.size + (window.ofs - self.ofs_end()), max_size)