def get_target(self, row, col, row_count, col_count):
<EOL>target = self._target<EOL>if self.row + row_count > self.max_row_count or self.col + col_count > self.max_col_count:<EOL><INDENT>row_delta = row - self.row if row + self.row_count <= self.max_row_count else <NUM_LIT:0><EOL>col_delta = col - self.col if col + self.col_count <= self.max_col_count else <NUM_LIT:0><EOL>target.gotoOffset(col_delta, row_delta)<EOL>self.row += row_delta<EOL>self.col += col_delta<EOL><DEDENT>if (row_count, col_count) != (self.row_count, self.col_count):<EOL><INDENT>target.collapseToSize(col_count, row_count)<EOL>self.row_count = row_count<EOL>self.col_count = col_count<EOL><DEDENT>if (row, col) != (self.row, self.col):<EOL><INDENT>target.gotoOffset(col - self.col, row - self.row)<EOL>self.row = row<EOL>self.col = col<EOL><DEDENT>return target<EOL>
Moves cursor to the specified position and returns in.