RebuildRegExpList();
+ // Update ViewWhitespace as it depends on m_bAllowMixedEol
+ mf->ApplyViewWhitespace();
+
// make an attempt at rescanning any open diff sessions
MergeDocList docs;
GetAllMergeDocs(&docs);
AfxGetApp()->WriteProfileInt(szRegSubKey, _T("Count"), cnt);
}
-void CMainFrame::OnViewWhitespace()
+/**
+ * @brief Apply tabs and eols settings to all merge documents
+ */
+void CMainFrame::ApplyViewWhitespace()
{
- m_bViewWhitespace = !m_bViewWhitespace;
- theApp.WriteProfileInt(_T("Settings"), _T("ViewWhitespace"), m_bViewWhitespace);
-
MergeDocList mergedocs;
GetAllMergeDocs(&mergedocs);
while (!mergedocs.IsEmpty())
if (pLeft)
{
pLeft->SetViewTabs(mf->m_bViewWhitespace);
- pLeft->SetViewEols(mf->m_bViewWhitespace);
+ pLeft->SetViewEols(mf->m_bViewWhitespace, mf->m_bAllowMixedEol);
}
if (pRight)
{
pRight->SetViewTabs(mf->m_bViewWhitespace);
- pRight->SetViewEols(mf->m_bViewWhitespace);
+ pRight->SetViewEols(mf->m_bViewWhitespace, mf->m_bAllowMixedEol);
}
if (pLeftDetail)
{
pLeftDetail->SetViewTabs(mf->m_bViewWhitespace);
- pLeftDetail->SetViewEols(mf->m_bViewWhitespace);
+ pLeftDetail->SetViewEols(mf->m_bViewWhitespace, mf->m_bAllowMixedEol);
}
if (pRightDetail)
{
pRightDetail->SetViewTabs(mf->m_bViewWhitespace);
- pRightDetail->SetViewEols(mf->m_bViewWhitespace);
+ pRightDetail->SetViewEols(mf->m_bViewWhitespace, mf->m_bAllowMixedEol);
}
}
}
+void CMainFrame::OnViewWhitespace()
+{
+ m_bViewWhitespace = !m_bViewWhitespace;
+ theApp.WriteProfileInt(_T("Settings"), _T("ViewWhitespace"), m_bViewWhitespace);
+
+ ApplyViewWhitespace();
+}
+
/// Enables View/View Whitespace menuitem when merge view is active
void CMainFrame::OnUpdateViewWhitespace(CCmdUI* pCmdUI)
{
BOOL CheckSavePath(CString& strSavePath);
BOOL SaveToVersionControl(CString& strSavePath);
CString SetStatus(LPCTSTR status);
+ void ApplyViewWhitespace();
// Overrides
// ClassWizard generated virtual function overrides
pRight->SetTabSize(mf->m_nTabSize);
pLeft->SetViewTabs(mf->m_bViewWhitespace);
pRight->SetViewTabs(mf->m_bViewWhitespace);
- pLeft->SetViewEols(mf->m_bViewWhitespace);
- pRight->SetViewEols(mf->m_bViewWhitespace);
+ pLeft->SetViewEols(mf->m_bViewWhitespace, mf->m_bAllowMixedEol);
+ pRight->SetViewEols(mf->m_bViewWhitespace, mf->m_bAllowMixedEol);
pLeftDetail->SetTabSize(mf->m_nTabSize);
pRightDetail->SetTabSize(mf->m_nTabSize);
pLeftDetail->SetViewTabs(mf->m_bViewWhitespace);
pRightDetail->SetViewTabs(mf->m_bViewWhitespace);
- pLeftDetail->SetViewEols(mf->m_bViewWhitespace);
- pRightDetail->SetViewEols(mf->m_bViewWhitespace);
+ pLeftDetail->SetViewEols(mf->m_bViewWhitespace, mf->m_bAllowMixedEol);
+ pRightDetail->SetViewEols(mf->m_bViewWhitespace, mf->m_bAllowMixedEol);
// Enable Backspace at beginning of line
pLeft->SetDisableBSAtSOL(FALSE);
#define SPACE_CHARACTER _T('\xB7') // U+B7: MIDDLE DOT
#define CR_CHARACTER _T('\xA7') // U+A7: SECTION SIGN
#define LF_CHARACTER _T('\xB6') // U+B6: PILCROW SIGN
+#define ANY_EOL_CHARACTER _T('\xA4') // U+A4: ?
#define DEFAULT_PRINT_MARGIN 1000 // 10 millimeters
LPTSTR pszBuf = line.GetBuffer(nLength + nTabCount * (nTabSize - 1) + 1);
int nCurPos = 0;
- if (nTabCount > 0 || m_bViewTabs)
+ if (nTabCount > 0 || m_bViewTabs || m_bViewEols)
{
for (i = 0; i < nLength; i++)
{
nSpaces--;
}
}
- else
+ else if (pszChars[i] == ' ' && m_bViewTabs)
+ pszBuf[nCurPos++] = SPACE_CHARACTER;
+ else if (pszChars[i] == '\r' || pszChars[i] == '\n')
{
- if (pszChars[i] == ' ' && m_bViewTabs)
- pszBuf[nCurPos] = SPACE_CHARACTER;
- else if (pszChars[i] == '\r' && m_bViewEols)
- pszBuf[nCurPos] = CR_CHARACTER;
- else if (pszChars[i] == '\n' && m_bViewEols)
- pszBuf[nCurPos] = LF_CHARACTER;
- else
- pszBuf[nCurPos] = pszChars[i];
-
- nCurPos++;
+ if (pszChars[i] == '\r' && m_bViewEols && m_bDistinguishEols)
+ pszBuf[nCurPos++] = CR_CHARACTER;
+ else if (pszChars[i] == '\n' && m_bViewEols && m_bDistinguishEols)
+ pszBuf[nCurPos++] = LF_CHARACTER;
+ else if (m_bViewEols)
+ {
+ pszBuf[nCurPos++] = ANY_EOL_CHARACTER;
+ // hide the second sign
+ i = nLength-1;
+ }
}
+ else
+ pszBuf[nCurPos++] = pszChars[i];
}
}
else
}
void CCrystalTextView::
-SetViewEols (BOOL bViewEols)
+SetViewEols (BOOL bViewEols, BOOL bDistinguishEols)
{
- if (bViewEols != m_bViewEols)
+ if (bViewEols != m_bViewEols || bDistinguishEols != m_bDistinguishEols)
{
m_bViewEols = bViewEols;
+ m_bDistinguishEols = bDistinguishEols;
if (::IsWindow (m_hWnd))
Invalidate ();
}
// Text attributes
BOOL m_bViewTabs;
BOOL m_bViewEols;
+ BOOL m_bDistinguishEols;
BOOL m_bSelMargin;
DWORD m_dwFlags;
void SetCRLFMode (int nCRLFMode);
BOOL GetViewTabs ();
void SetViewTabs (BOOL bViewTabs);
- void SetViewEols (BOOL bViewEols);
+ void SetViewEols (BOOL bViewEols, BOOL bDistinguishEols);
int GetTabSize ();
void SetTabSize (int nTabSize);
BOOL GetSelectionMargin ();
+2003-10-09 Laoran
+ [ 819219 ] Show only simple EOL char when no mixing EOL modes allowed
+ WinMerge: MainFrm.cpp MainFrm.h MergeDoc.cpp ccrystaltextview.cpp ccrystaltextview.h
+
2003-10-09 Perry
Fix duplicate copy of IDS_LINE_STATUS_INFO (to IDS_LINE_STATUS_INFO_EOL) in most
language files. Fix missing id ID_POPUP_COPYFROMOTHERSIDE in German file