bool TryInlineScalar(YamlScalar obj, int maximumWidth, out string result) { result = obj.ToString(); if (result.Length > maximumWidth) { result = null; } return(result != null); }
void WriteScalar(YamlScalar obj) { if (TryInlineScalar(obj, _maximumWidth - _indentColumn, out var inlined)) { WriteInline(inlined); } else { Write(obj.ToString()); } }