From bc6cd9c69fad892da1a6f702e47e4a4692329dc5 Mon Sep 17 00:00:00 2001 From: sdottaka Date: Mon, 20 Jan 2014 22:45:51 +0900 Subject: [PATCH] Draw 3way-diff state on Location View --HG-- branch : stable --- Src/LocationView.cpp | 12 ++++++++++++ Src/LocationView.h | 1 + 2 files changed, 13 insertions(+) diff --git a/Src/LocationView.cpp b/Src/LocationView.cpp index 8826c7fe1..18fb81416 100644 --- a/Src/LocationView.cpp +++ b/Src/LocationView.cpp @@ -326,6 +326,7 @@ void CLocationView::CalculateBlocks() block.top_coord = nBeginY; block.bottom_coord = nEndY; block.diff_index = nDiff; + block.op = diff.op; m_diffBlocks.push_back(block); } @@ -440,6 +441,17 @@ void CLocationView::OnDraw(CDC* pDC) { if (pDoc->IsEditedAfterRescan(pane)) continue; + // Draw 3way-diff state + if (pDoc->m_nBuffers == 3 && pane < 2) + { + CRect r(m_bar[pane].right - 1, (*iter).top_coord, m_bar[pane + 1].left + 1, (*iter).bottom_coord); + if ((pane == 0 && (*iter).op == OP_3RDONLY) || (pane == 1 && (*iter).op == OP_1STONLY)) + DrawRect(&dc, r, RGB(255, 255, 127), false); + else if ((*iter).op == OP_2NDONLY) + DrawRect(&dc, r, RGB(127, 255, 255), false); + else if ((*iter).op == OP_DIFF) + DrawRect(&dc, r, RGB(255, 0, 0), false); + } // Draw block m_view[pane]->GetLineColors2((*iter).top_line, 0, cr[pane], crt, bwh); CRect r(m_bar[pane].left, (*iter).top_coord, m_bar[pane].right, (*iter).bottom_coord); diff --git a/Src/LocationView.h b/Src/LocationView.h index c97bac3f6..a28e2fb62 100644 --- a/Src/LocationView.h +++ b/Src/LocationView.h @@ -53,6 +53,7 @@ struct DiffBlock unsigned top_coord; /**< X-coord of diff block begin. */ unsigned bottom_coord; /**< X-coord of diff block end. */ unsigned diff_index; /**< Index of difference in the original diff list. */ + int op; }; /** -- 2.11.0