260809.1.4 · 750a6ccc65d11953d1cdb8ea744c37a31e607425
https://gitlab.com/saalen/highlight/-/work_items/240 emit the IndentGuide style and colour only when guides are enabled
reading declarations
@@ -296,8 +296,11 @@ string HtmlGenerator::getStyleDefinition() << getAttributes ( STY_NAME_LIN, docStyle.getLineStyle() ) << getAttributes ( STY_NAME_HVR, docStyle.getHoverStyle() ) << getAttributes ( STY_NAME_ERM, docStyle.getErrorMessageStyle() )- << getAttributes ( STY_NAME_ERR, docStyle.getErrorStyle() )- << getAttributes ( STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ << getAttributes ( STY_NAME_ERR, docStyle.getErrorStyle() );++ if ( showIndentGuides ) {+ os << getAttributes ( STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ } for ( const auto &[first, second] : docStyle.getKeywordStyles() ) { os << getAttributes ( first, second );
@@ -332,7 +332,9 @@ string LatexGenerator::getStyleDefinition() os << getAttributes ( STY_NAME_ERR, docStyle.getErrorStyle() ); os << getAttributes ( STY_NAME_ERM, docStyle.getErrorMessageStyle() );- os << getAttributes ( STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ if ( showIndentGuides ) {+ os << getAttributes ( STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ } for ( const auto &[first, second] : docStyle.getKeywordStyles() ) { os << getAttributes ( first, second );
@@ -69,8 +69,11 @@ string ODTGenerator::getStyleDefinition() << getAttributes ( STY_NAME_IPL, docStyle.getInterpolationStyle() ) << getAttributes ( STY_NAME_LIN, docStyle.getLineStyle() ) << getAttributes ( STY_NAME_ERR, docStyle.getErrorStyle() )- << getAttributes ( STY_NAME_ERM, docStyle.getErrorMessageStyle() )- << getAttributes ( STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ << getAttributes ( STY_NAME_ERM, docStyle.getErrorMessageStyle() );++ if ( showIndentGuides ) {+ os << getAttributes ( STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ } for ( const auto &[first, second] : docStyle.getKeywordStyles() ) { os << getAttributes ( first, second );
@@ -119,12 +119,14 @@ string RtfGenerator::getHeader() s << getAttributes ( docStyle.getKeywordStyle ( keywordClasses[i] ) ); } - // the guide colour is appended after the (variable-length) keyword classes,- // so its colour table index has to be computed here rather than in initOutputTags()- int guideStyleNumber = KEYWORD + ( int ) keywordClasses.size();- s << getAttributes ( docStyle.getIndentGuideStyle() );- guideTagOpen = getOpenTag ( guideStyleNumber, docStyle.getIndentGuideStyle() );- guideTagClose = getCloseTag ( docStyle.getIndentGuideStyle() );+ if ( showIndentGuides ) {+ // the guide colour is appended after the (variable-length) keyword classes,+ // so its colour table index has to be computed here rather than in initOutputTags()+ int guideStyleNumber = KEYWORD + ( int ) keywordClasses.size();+ s << getAttributes ( docStyle.getIndentGuideStyle() );+ guideTagOpen = getOpenTag ( guideStyleNumber, docStyle.getIndentGuideStyle() );+ guideTagClose = getCloseTag ( docStyle.getIndentGuideStyle() );+ } s << "}\n";
@@ -102,7 +102,9 @@ string SVGGenerator::getStyleDefinition() os << getAttributes ( tspan+STY_NAME_ERM, docStyle.getErrorMessageStyle() ); os << getAttributes ( tspan+STY_NAME_ERR, docStyle.getErrorStyle() );- os << getAttributes ( tspan+STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ if ( showIndentGuides ) {+ os << getAttributes ( tspan+STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ } for ( const auto &[first, second] : docStyle.getKeywordStyles() ) { os << getAttributes ( tspan+first, second );
@@ -265,7 +265,9 @@ string TexGenerator::getStyleDefinition() os << getAttributes ( STY_NAME_ERR, docStyle.getErrorStyle() ); os << getAttributes ( STY_NAME_ERM, docStyle.getErrorMessageStyle() );- os << getAttributes ( STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ if ( showIndentGuides ) {+ os << getAttributes ( STY_NAME_GUI, docStyle.getIndentGuideStyle() );+ } for ( const auto &[first, second] : docStyle.getKeywordStyles() ) { os << getAttributes ( first, second );