def setSyntax(self, syntax):
        """Choose smart indentation algorithm according to syntax"""
        self._smartIndenter = self._chooseSmartIndenter(syntax)
def reorder_item(self, item, position):
    new_position = min(max(position, 0), len(self._items) - 1)