diff --git a/sakura_core/doc/CLineComment.h b/sakura_core/doc/CLineComment.h index 6030deb331..b59aeb215d 100644 --- a/sakura_core/doc/CLineComment.h +++ b/sakura_core/doc/CLineComment.h @@ -38,7 +38,7 @@ class CLineComment void CopyTo( const int n, const wchar_t* buffer, int nCommentPos ); // 行コメントデリミタをコピーする bool Match( int nPos, const CStringRef& cStr ) const; // 行コメントに値するか確認する - const wchar_t* getLineComment( const int n ){ + const wchar_t* getLineComment( const int n ) const{ return m_pszLineComment[n]; } int getLineCommentPos( const int n ) const { diff --git a/sakura_core/view/colors/CColor_Comment.h b/sakura_core/view/colors/CColor_Comment.h index 868f2bc2d2..7997e0495a 100644 --- a/sakura_core/view/colors/CColor_Comment.h +++ b/sakura_core/view/colors/CColor_Comment.h @@ -37,7 +37,18 @@ class CColor_LineComment : public CColorStrategy{ virtual void InitStrategyStatus(){} virtual bool BeginColor(const CStringRef& cStr, int nPos); virtual bool EndColor(const CStringRef& cStr, int nPos); - virtual bool Disp() const { return m_pTypeData->m_ColorInfoArr[COLORIDX_COMMENT].m_bDisp; } + virtual bool Disp() const { + // タイプ別設定 『カラー』プロパティのコメントのリストアイテムのチェックが付いているか + if (!m_pTypeData->m_ColorInfoArr[COLORIDX_COMMENT].m_bDisp) + return false; + // 行型コメントの始点記号が入力されているか + auto& lineComment = m_pTypeData->m_cLineComment; + for (int i = 0; i < COMMENT_DELIMITER_NUM; ++i) { + if (lineComment.getLineComment(i)[0]) + return true; + } + return false; + } }; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- // @@ -57,7 +68,13 @@ class CColor_BlockComment : public CColorStrategy{ virtual void InitStrategyStatus(){ m_nCOMMENTEND = 0; } virtual bool BeginColor(const CStringRef& cStr, int nPos); virtual bool EndColor(const CStringRef& cStr, int nPos); - virtual bool Disp() const { return m_pTypeData->m_ColorInfoArr[COLORIDX_COMMENT].m_bDisp; } + virtual bool Disp() const { + // タイプ別設定 『カラー』プロパティのコメントのリストアイテムのチェックが付いているか + if (!m_pTypeData->m_ColorInfoArr[COLORIDX_COMMENT].m_bDisp) + return false; + // ブロック型の始点・終端記号が入力されているか + return m_pcBlockComment->getBlockFromLen() > 0 && m_pcBlockComment->getBlockToLen() > 0; + } private: EColorIndexType m_nType; const CBlockComment* m_pcBlockComment;