Skip to content

Commit

Permalink
testing something otu
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Oct 20, 2023
1 parent e71072b commit deaeedb
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions kyaml/internal/forked/github.com/go-yaml/yaml/emitterc.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,9 @@ func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool {
// Check if we need to accumulate more events before emitting.
//
// We accumulate extra
// - 1 event for DOCUMENT-START
// - 2 events for SEQUENCE-START
// - 3 events for MAPPING-START
//
// - 1 event for DOCUMENT-START
// - 2 events for SEQUENCE-START
// - 3 events for MAPPING-START
func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool {
if emitter.events_head == len(emitter.events) {
return true
Expand Down Expand Up @@ -241,10 +240,10 @@ func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool
emitter.indent += 2
} else {
// Everything else aligns to the chosen indentation.
emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent)
}
if compact_seq {
emitter.indent = emitter.indent - 2
emitter.indent = emitter.best_indent * ((emitter.indent + emitter.best_indent) / emitter.best_indent)
if compact_seq {
emitter.indent = emitter.indent - 2
}
}
}
return true
Expand Down Expand Up @@ -733,7 +732,7 @@ func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_
if first {
seq := emitter.mapping_context && (emitter.column == 0 || !emitter.indention) &&
emitter.compact_sequence_indent
if !yaml_emitter_increase_indent(emitter, false, false, seq){
if !yaml_emitter_increase_indent(emitter, false, false, seq) {
return false
}
}
Expand Down

0 comments on commit deaeedb

Please sign in to comment.