OSDN Git Service

Fix issue #970: When moving in the scroll pane, the selected position is incorrect
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Wed, 15 Sep 2021 00:05:32 +0000 (09:05 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Wed, 15 Sep 2021 00:05:32 +0000 (09:05 +0900)
Src/MergeEditView.cpp

index 9ce133f..48c4413 100644 (file)
@@ -3285,7 +3285,7 @@ void CMergeEditView::GotoLine(UINT nLine, bool bRealLine, int pane, bool bMoveAn
                CPoint pt = (ptPos.y < pView->GetLineCount()) ? ptPos : CPoint(ptPos.x, pView->GetLineCount() - 1);
                pt.x = std::clamp(static_cast<int>(pt.x), 0, pView->GetLineLength(pt.y));
                pView->SetCursorPos(pt);
-               if (bMoveAnchor)
+               if (bMoveAnchor || nPane != pane)
                        pView->SetAnchor(pt);
                pView->SetSelection(pView->GetAnchor(), pt);
                pView->EnsureVisible(pt);