code: def indent(buffer, from_row, to_row, count=1):
      
      current_row = buffer.document.cursor_position_row
      line_range = range(from_row, to_row)
  
      # Apply transformation.
      new_text = buffer.transform_lines(line_range, lambda l: '    ' * count + l)
      buffer.document = Document(
          new_text,
          Document(new_text).translate_row_col_to_index(current_row, 0))
  
      # Go to the start of the line.
      buffer.cursor_position += buffer.document.get_start_of_line_position(after_whitespace=True)
docs: Indent text of a :class:`.Buffer` object.