From 884b280fefe6300aafa8dcb19872fb081d42be9c Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sun, 7 Mar 2004 17:57:26 +0000 Subject: [PATCH] RFE: [ 874366 ] Add goto line-number --- Src/MergeEditView.cpp | 17 +++++++++++++++-- Src/readme.txt | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Src/MergeEditView.cpp b/Src/MergeEditView.cpp index b74870dcd..e7a625bf3 100644 --- a/Src/MergeEditView.cpp +++ b/Src/MergeEditView.cpp @@ -1743,13 +1743,26 @@ void CMergeEditView::OnUpdateChangePane(CCmdUI* pCmdUI) } /** - * @brief Show "Go To" dialog and scroll views to line or diff + * @brief Show "Go To" dialog and scroll views to line or diff. + * + * Before dialog is opened, current line and file is determined + * and selected. + * @note Conversions needed between apparent and real lines */ void CMergeEditView::OnWMGoto() { CWMGotoDlg dlg; + CMergeDoc *pDoc = GetDocument(); + CPoint pos = GetCursorPos(); + int nRealLine = 0; + + if (m_bIsLeft) + nRealLine = pDoc->m_ltBuf.ComputeRealLine(pos.y); + else + nRealLine = pDoc->m_rtBuf.ComputeRealLine(pos.y); - // Set active file selected in dialog + // Set active file and current line selected in dialog + dlg.m_strParam.Format(_T("%d"), nRealLine + 1); dlg.m_nFile = m_bIsLeft ? 0 : 1; dlg.m_nGotoWhat = 0; diff --git a/Src/readme.txt b/Src/readme.txt index c0421276e..398f17886 100644 --- a/Src/readme.txt +++ b/Src/readme.txt @@ -4,6 +4,9 @@ DirDoc.h MainFrm.cpp MainFrm.h MergeDoc.cpp MergeDoc.h OptionsDef.h PATCH: [ 906872 ] Change ShellExtension to open directories non-recursive ShellExtension: ShellExtension.rc WinMergeShell.cpp WinMergeShell.h + RFE: [ 874366 ] Add goto line-number + Improvement: Show file's current line in Goto-dialog as selected + Src: MergeEditView.cpp 2004-03-06 WinMerge experimental release 2.1.5.13 (cvs) -- 2.11.0