Skip to content

Commit

Permalink
Fix problem of not moving to conflicted line after auto-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Apr 22, 2023
1 parent b79afb7 commit 5cd81bf
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions Src/MergeDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3339,15 +3339,24 @@ void CMergeDoc::MoveOnLoad(int nPane, int nLineIndex, bool bRealLine, int nCharI
}
if (nLineIndex == -1)
{
// scroll to first diff
if (GetOptionsMgr()->GetBool(OPT_SCROLL_TO_FIRST) &&
m_diffList.HasSignificantDiffs())
if (this->GetCurrentDiff() != -1)
{
int nDiff = m_diffList.FirstSignificantDiff();
if (nDiff != -1)
m_pView[0][nPane]->SelectDiff(nDiff, true, false);
m_pView[0][nPane]->SetActivePane();
return;
DIFFRANGE di;
m_diffList.GetDiff(this->GetCurrentDiff(), di);
nLineIndex = bRealLine ? di.begin[nPane] : di.dbegin;
}
else
{
// scroll to first diff
if (GetOptionsMgr()->GetBool(OPT_SCROLL_TO_FIRST) &&
m_diffList.HasSignificantDiffs())
{
int nDiff = m_diffList.FirstSignificantDiff();
if (nDiff != -1)
m_pView[0][nPane]->SelectDiff(nDiff, true, false);
m_pView[0][nPane]->SetActivePane();
return;
}
}
}
m_pView[0][nPane]->GotoLine(nLineIndex < 0 ? 0 : nLineIndex, bRealLine, nPane, true, nCharIndex);
Expand Down

0 comments on commit 5cd81bf

Please sign in to comment.