Fixed settings reverting properly

This commit is contained in:
Jesse Beder
2012-05-22 15:00:10 -05:00
parent bf07af52ff
commit 944ebb7d1e
3 changed files with 5 additions and 5 deletions

View File

@@ -402,7 +402,7 @@ namespace YAML
case EmitterNodeType::Scalar:
case EmitterNodeType::FlowSeq:
case EmitterNodeType::FlowMap:
SpaceOrIndentTo(m_pState->HasBegunContent(), curIndent);
SpaceOrIndentTo(true, curIndent);
break;
case EmitterNodeType::BlockSeq:
case EmitterNodeType::BlockMap:

View File

@@ -106,6 +106,7 @@ namespace YAML
void EmitterState::StartedScalar()
{
StartedNode();
ClearModifiedSettings();
}
void EmitterState::StartedGroup(GroupType::value type)
@@ -150,6 +151,8 @@ namespace YAML
// some global settings that we changed may have been overridden
// by a local setting we just popped, so we need to restore them
m_globalModifiedSettings.restore();
ClearModifiedSettings();
}
EmitterNodeType::value EmitterState::CurGroupNodeType() const

View File

@@ -5,10 +5,7 @@ int main()
{
YAML::Emitter out;
out << YAML::BeginMap;
out << YAML::BeginMap;
out << "a" << "b";
out << YAML::EndMap;
out << YAML::BeginMap;
out << YAML::LongKey << "a" << "b";
out << "a" << "b";
out << YAML::EndMap;
out << YAML::EndMap;