summaryrefslogtreecommitdiff
path: root/util.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2016-02-27 14:53:44 +0100
committerAnthon van der Neut <anthon@mnt.org>2016-02-27 14:53:44 +0100
commit638b3d07b210f8636507c1530e925445f9c3aba9 (patch)
treed0c35dd79eae8ed610a9e33df8c3ea8b4e76a767 /util.py
parent0fbfd2d3f7895ebae49dc85abbe8844abb0e19bf (diff)
downloadruamel.yaml-638b3d07b210f8636507c1530e925445f9c3aba9.tar.gz
implement indent for scalar list elements
Diffstat (limited to 'util.py')
-rw-r--r--util.py4
1 files changed, 3 insertions, 1 deletions
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