code: def _order_decorations(self):
          
          def order_function(sel):
              end = sel.cursor.selectionEnd()
              start = sel.cursor.selectionStart()
              return sel.draw_order, -(end - start)
  
          self._decorations = sorted(self._decorations,
                                     key=order_function)
docs: Order decorations according draw_order and size of selection.
  
          Highest draw_order will appear on top of the lowest values.
  
          If draw_order is equal,smaller selections are draw in top of
          bigger selections.