code: def _onShortcutMoveLine(self, down):
          
          startBlock, endBlock = self._selectedBlocks()
  
          startBlockNumber = startBlock.blockNumber()
          endBlockNumber = endBlock.blockNumber()
  
          def _moveBlock(block, newNumber):
              text = block.text()
              with self:
                  del self.lines[block.blockNumber()]
                  self.lines.insert(newNumber, text)
  
          if down:  # move next block up
              blockToMove = endBlock.next()
              if not blockToMove.isValid():
                  return
  
              # if operaiton is UnDone, marks are located incorrectly
              markMargin = self.getMargin("mark_area")
              if markMargin:
                  markMargin.clearBookmarks(startBlock, endBlock.next())
  
              _moveBlock(blockToMove, startBlockNumber)
  
              self._selectLines(startBlockNumber + 1, endBlockNumber + 1)
          else:  # move previous block down
              blockToMove = startBlock.previous()
              if not blockToMove.isValid():
                  return
  
              # if operaiton is UnDone, marks are located incorrectly
              markMargin = self.getMargin("mark_area")
              if markMargin:
                  markMargin.clearBookmarks(startBlock, endBlock)
  
              _moveBlock(blockToMove, endBlockNumber)
  
              self._selectLines(startBlockNumber - 1, endBlockNumber - 1)
  
          if markMargin:
              markMargin.update()
docs: Move line up or down
          Actually, not a selected text, but next or previous block is moved
          TODO keep bookmarks when moving