Merge f8ff3ac8e4 into e0e01d53c2
This commit is contained in:
commit
429205a487
@ -113,11 +113,13 @@ inline _Tag SecondaryTag(const std::string content) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct _Comment {
|
struct _Comment {
|
||||||
_Comment(const std::string& content_) : content(content_) {}
|
_Comment(const std::string& content_, int col = -1) : content(content_), indent_col(col), indent_to(col > 0) {}
|
||||||
std::string content;
|
std::string content;
|
||||||
|
size_t indent_col;
|
||||||
|
bool indent_to;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline _Comment Comment(const std::string content) { return _Comment(content); }
|
inline _Comment Comment(const std::string content, int col = -1) { return _Comment(content, col); }
|
||||||
|
|
||||||
struct _Precision {
|
struct _Precision {
|
||||||
_Precision(int floatPrecision_, int doublePrecision_)
|
_Precision(int floatPrecision_, int doublePrecision_)
|
||||||
|
|||||||
@ -872,7 +872,12 @@ Emitter& Emitter::Write(const _Comment& comment) {
|
|||||||
PrepareNode(EmitterNodeType::NoType);
|
PrepareNode(EmitterNodeType::NoType);
|
||||||
|
|
||||||
if (m_stream.col() > 0)
|
if (m_stream.col() > 0)
|
||||||
|
{
|
||||||
|
if(comment.indent_to && comment.indent_col > m_stream.col())
|
||||||
|
m_stream << IndentTo(comment.indent_col);
|
||||||
|
else
|
||||||
m_stream << Indentation(m_pState->GetPreCommentIndent());
|
m_stream << Indentation(m_pState->GetPreCommentIndent());
|
||||||
|
}
|
||||||
Utils::WriteComment(m_stream, comment.content,
|
Utils::WriteComment(m_stream, comment.content,
|
||||||
m_pState->GetPostCommentIndent());
|
m_pState->GetPostCommentIndent());
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user