class Rouge::Lexers::YAML

def save_indent(match)

Save a possible indentation level
def save_indent(match)
  @next_indent = match.size
  puts "    yaml: indent: #{self.indent}/#@next_indent" if @debug
  puts "    yaml: popping indent stack - before: #@indent_stack" if @debug
  if dedent?(@next_indent)
    @indent_stack.pop while dedent?(@next_indent)
    puts "    yaml: popping indent stack - after: #@indent_stack" if @debug
    puts "    yaml: indent: #{self.indent}/#@next_indent" if @debug
    # dedenting to a state not previously indented to is an error
    [match[0...self.indent], match[self.indent..-1]]
  else
    [match, '']
  end
end