bool TryInlineScalar(YamlScalar obj, int maximumWidth, [MaybeNullWhen(false)] out string result) { result = obj.ToString(); if (result.Length > maximumWidth) { result = null; } return(result is not null); }
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, bool allowInlining) { if (allowInlining && TryInlineScalar(obj, _maximumWidth - _indentColumn, out var inlined)) { WriteInline(inlined); } else { Write(obj.ToString()); } }