OSDN Git Service

3way-diff: Don't highlight the word diff in right pane for visibility if the word...
authorsdottaka <none@none>
Thu, 23 Jan 2014 14:10:53 +0000 (23:10 +0900)
committersdottaka <none@none>
Thu, 23 Jan 2014 14:10:53 +0000 (23:10 +0900)
, and don't highlight the word diff in left pane if the word diff is OP_3RDONLY(left==center)
for

--HG--
branch : stable

Src/MergeDoc.h
Src/MergeDocLineDiffs.cpp
Src/MergeEditView.cpp
Src/stringdiffs.h

index 144e074..de2ecab 100644 (file)
@@ -115,7 +115,9 @@ struct WordDiff {
        int end[3]; // 0-based, eg, end[1] is from str2
        int beginline[3];
        int endline[3];
-       WordDiff(int s1=0, int e1=0, int bl1=0, int el1=0, int s2=0, int e2=0, int bl2=0, int el2=0, int s3=0, int e3=0, int bl3=0, int el3=0)
+       int op;
+       WordDiff(int s1=0, int e1=0, int bl1=0, int el1=0, int s2=0, int e2=0, int bl2=0, int el2=0, int s3=0, int e3=0, int bl3=0, int el3=0, int op=0)
+               : op(op)
        {
                if (s1>e1) e1=s1;
                if (s2>e2) e2=s2;
@@ -142,6 +144,7 @@ struct WordDiff {
                        beginline[i] = src.beginline[i];
                        endline[i] = src.endline[i];
                }
+               op = src.op;
        }
 };
 
index 4c36741..e4ff845 100644 (file)
@@ -249,6 +249,7 @@ void CMergeDoc::GetWordDiffArray(int nLineIndex, vector<WordDiff> *pWordDiffs)
                        if (m_ptBuf[file]->GetLineLength(nLine) < wd.end[file])
                                wd.end[file] = m_ptBuf[file]->GetLineLength(nLine);
                }
+               wd.op = it->op;
 
                pWordDiffs->push_back(wd);
        }
index b9bb06e..0a81384 100644 (file)
@@ -424,6 +424,13 @@ int CMergeEditView::GetAdditionalTextBlocks (int nLineIndex, TEXTBLOCK *&pBuf)
        {
                if (worddiffs[i].beginline[m_nThisPane] > nLineIndex || worddiffs[i].endline[m_nThisPane] < nLineIndex )
                        continue;
+               if (pDoc->m_nBuffers > 2)
+               {
+                       if (m_nThisPane == 0 && worddiffs[i].op == OP_3RDONLY)
+                               continue;
+                       else if (m_nThisPane == 2 && worddiffs[i].op == OP_1STONLY)
+                               continue;
+               }
                int begin[3], end[3];
                bool deleted = false;
                for (int pane = 0; pane < pDoc->m_nBuffers; pane++)
index 9eb32a7..96abb03 100644 (file)
@@ -38,6 +38,7 @@ struct wdiff {
                        begin[i] = src.begin[i];
                        end[i] = src.end[i];
                }
+               op = src.op;
        }
 };