From ca808dbac14c29c8cb2106ad8c8514bfcb8297d8 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 22 Jul 2009 22:59:51 +0800 Subject: [PATCH] Sync dialog output log message okay. Signed-off-by: Frank Li --- src/TortoiseProc/ProgressDlg.cpp | 2 +- src/TortoiseProc/SyncDlg.cpp | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/TortoiseProc/ProgressDlg.cpp b/src/TortoiseProc/ProgressDlg.cpp index 386ca0e..af71e5b 100644 --- a/src/TortoiseProc/ProgressDlg.cpp +++ b/src/TortoiseProc/ProgressDlg.cpp @@ -109,7 +109,7 @@ UINT CProgressDlg::RunCmdList(CWnd *pWnd,std::vector &cmdlist,bool bSho if (bShowCommand) { CString str; - str+= cmdlist[i]+_T("\r\n\r\n"); + str+= cmdlist[i]+_T("\n\n"); for(int j=0;jPostMessage(MSG_PROGRESSDLG_UPDATE_UI,MSG_PROGRESSDLG_RUN,str[j]); } diff --git a/src/TortoiseProc/SyncDlg.cpp b/src/TortoiseProc/SyncDlg.cpp index c15b328..59ba970 100644 --- a/src/TortoiseProc/SyncDlg.cpp +++ b/src/TortoiseProc/SyncDlg.cpp @@ -433,13 +433,23 @@ void CSyncDlg::ParserCmdOutput(TCHAR ch) TRACE(_T("End Char %s \r\n"),ch==_T('\n')?_T("cr"):_T("")); int linenum = this->m_ctrlCmdOut.GetLineCount(); - int index = this->m_ctrlCmdOut.LineIndex(linenum-1); - if(linenum == 0) - index = 0; + int index ; + if(ch == _T('\r')) + { + index = this->m_ctrlCmdOut.LineIndex(linenum-1); + + if(linenum == 0) + index = 0; + } + else + { + index=-1; + } + this->m_ctrlCmdOut.SetSel(index,-1); - this->m_ctrlCmdOut.ReplaceSel(m_LogText); + this->m_ctrlCmdOut.ReplaceSel(CString(_T("\n"))+m_LogText); this->m_ctrlCmdOut.LineScroll(linenum-1); -- 2.11.0