def _keep_cursor_in_buffer(self):
moved = not self._in_buffer()<EOL>if moved:<EOL><INDENT>cursor = self._control.textCursor()<EOL>cursor.movePosition(QtGui.QTextCursor.End)<EOL>self._control.setTextCursor(cursor)<EOL><DEDENT>return moved<EOL>
Ensures that the cursor is inside the editing region. Returns
            whether the cursor was moved.