From 50f3edb9d6698923e470f397ecaa35f722a92966 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Wed, 6 Sep 2023 21:54:05 +0900 Subject: [PATCH] When "Use First Line as Header" is enabled, make the header display the first line regardless of the scroll position when the first line is hidden. --- Externals/crystaledit/editlib/ccrystaltextview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Externals/crystaledit/editlib/ccrystaltextview.cpp b/Externals/crystaledit/editlib/ccrystaltextview.cpp index 1bf50989c51..6e2b1db15e2 100644 --- a/Externals/crystaledit/editlib/ccrystaltextview.cpp +++ b/Externals/crystaledit/editlib/ccrystaltextview.cpp @@ -2491,7 +2491,8 @@ GetTopMarginText (const CRect& rect, CString& text, std::vector& nWidths) { int nColumnWidth = m_pTextBuffer->GetColumnWidth (nColumn); CString columnName; - if (m_nTopSubLine > 0 && m_nLineNumberUsedAsHeaders >= 0 && m_nLineNumberUsedAsHeaders < m_pTextBuffer->GetLineCount()) + if (m_nLineNumberUsedAsHeaders >= 0 && m_nLineNumberUsedAsHeaders < m_pTextBuffer->GetLineCount() && + (m_nTopSubLine > 0 || (m_pTextBuffer->GetLineFlags(m_nLineNumberUsedAsHeaders) & LF_INVISIBLE))) columnName = replaceControlChars (m_pTextBuffer->GetCellText (m_nLineNumberUsedAsHeaders, nColumn).c_str ()); // Use std::basic_string instead of CString if (columnName.IsEmpty()) columnName = GetColumnName (nColumn);