From 638b3d07b210f8636507c1530e925445f9c3aba9 Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Sat, 27 Feb 2016 14:53:44 +0100 Subject: implement indent for scalar list elements --- util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util.py') diff --git a/util.py b/util.py index 324bdc7..ed7b67c 100644 --- a/util.py +++ b/util.py @@ -44,11 +44,13 @@ def load_yaml_guess_indent(stream): continue if prev_line_key_only is not None and rline: idx = 0 - while line[idx] in ' -': # this will end on ':' + while line[idx] in ' -': idx += 1 if idx > prev_line_key_only: indent = idx - prev_line_key_only break + else: + indent = 2 prev_line_key_only = None return round_trip_load(yaml_str), indent -- cgit v1.2.1