From 2d387553e6333cb001a9cea1152e921306fa59f6 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 12 Feb 2017 12:11:18 +0100 Subject: [PATCH] Allow to diff multiple files at once Signed-off-by: Sven Strickroth --- src/Git/GitStatusListCtrl.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Git/GitStatusListCtrl.cpp b/src/Git/GitStatusListCtrl.cpp index 74df5695d..c852798cc 100644 --- a/src/Git/GitStatusListCtrl.cpp +++ b/src/Git/GitStatusListCtrl.cpp @@ -1649,16 +1649,13 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point) if (!m_Rev1.IsEmpty() && !m_Rev2.IsEmpty()) { - if(GetSelectedCount() == 1) + if (m_dwContextMenus & this->GetContextMenuBit(IDGITLC_COMPARETWOREVISIONS)) { - if (m_dwContextMenus & this->GetContextMenuBit(IDGITLC_COMPARETWOREVISIONS)) - { - popup.AppendMenuIcon(IDGITLC_COMPARETWOREVISIONS, IDS_LOG_POPUP_COMPARETWO, IDI_DIFF); - popup.SetDefaultItem(IDGITLC_COMPARETWOREVISIONS, FALSE); - } - if (m_dwContextMenus & this->GetContextMenuBit(IDGITLC_GNUDIFF2REVISIONS)) - popup.AppendMenuIcon(IDGITLC_GNUDIFF2REVISIONS, IDS_LOG_POPUP_GNUDIFF, IDI_DIFF); + popup.AppendMenuIcon(IDGITLC_COMPARETWOREVISIONS, IDS_LOG_POPUP_COMPARETWO, IDI_DIFF); + popup.SetDefaultItem(IDGITLC_COMPARETWOREVISIONS, FALSE); } + if (m_dwContextMenus & this->GetContextMenuBit(IDGITLC_GNUDIFF2REVISIONS)) + popup.AppendMenuIcon(IDGITLC_GNUDIFF2REVISIONS, IDS_LOG_POPUP_GNUDIFF, IDI_DIFF); } //Select Multi item @@ -2132,7 +2129,14 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point) case IDGITLC_GNUDIFF2REVISIONS: { - CAppUtils::StartShowUnifiedDiff(m_hWnd, *filepath, m_Rev2, *filepath, m_Rev1, bShift); + if (!CheckMultipleDiffs()) + break; + POSITION pos = GetFirstSelectedItemPosition(); + while (pos) + { + auto entry = GetListEntry(GetNextSelectedItem(pos)); + CAppUtils::StartShowUnifiedDiff(m_hWnd, *entry, m_Rev2, *entry, m_Rev1, bShift); + } } break; -- 2.11.4.GIT