mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Fixed basic block seq indentation
This commit is contained in:
@@ -313,13 +313,15 @@ namespace YAML
|
||||
void Emitter::BlockSeqPrepareNode()
|
||||
{
|
||||
const unsigned curIndent = m_pState->CurIndent();
|
||||
if(m_stream.col() > curIndent) {
|
||||
if(!m_pState->HasTag() && !m_pState->HasAnchor()) {
|
||||
if(m_pState->CurGroupChildCount() > 0) {
|
||||
m_stream << "\n";
|
||||
}
|
||||
m_stream << IndentTo(curIndent);
|
||||
m_stream << "-";
|
||||
m_stream << IndentTo(curIndent + m_pState->CurGroupIndent());
|
||||
}
|
||||
}
|
||||
|
||||
void Emitter::FlowMapPrepareNode()
|
||||
{
|
||||
|
@@ -119,6 +119,11 @@ namespace YAML
|
||||
return m_groups.empty() ? 0 : m_groups.top().indent;
|
||||
}
|
||||
|
||||
std::size_t EmitterState::CurGroupChildCount() const
|
||||
{
|
||||
return m_groups.empty() ? 0 : m_groups.top().childCount;
|
||||
}
|
||||
|
||||
void EmitterState::ClearModifiedSettings()
|
||||
{
|
||||
m_modifiedSettings.clear();
|
||||
|
@@ -40,6 +40,7 @@ namespace YAML
|
||||
GroupType::value CurGroupType() const;
|
||||
FlowType::value CurGroupFlowType() const;
|
||||
int CurGroupIndent() const;
|
||||
std::size_t CurGroupChildCount() const;
|
||||
int CurIndent() const { return m_curIndent; }
|
||||
bool HasAnchor() const { return m_hasAnchor; }
|
||||
bool HasTag() const { return m_hasTag; }
|
||||
|
Reference in New Issue
Block a user