def onAutoIndentTriggered(self):
        """Indent current line or selected lines
        """
        cursor = self._qpart.textCursor()

        startBlock = self._qpart.document().findBlock(cursor.selectionStart())
        endBlock = self._qpart.document().findBlock(cursor.selectionEnd())

        if startBlock != endBlock:  # indent multiply lines
            stopBlock = endBlock.next()

            block = startBlock

            with self._qpart:
                while block != stopBlock:
                    self.autoIndentBlock(block, '')
                    block = block.next()
        else:  # indent 1 line
            self.autoIndentBlock(startBlock, '')
def _split_vertical(container):
		r1 = None
		r2 = None
		min_w = int(W_RATIO*container.h)+1
		if container.w < 2*min_w:
			return None
		r1 = Container(container.x,container.y,randint(min_w, container.w-min_w),container.h)
		r2 = Container(container.x+r1.w,container.y,container.w-r1.w,container.h)
		return [r1, r2]