Skip to content

Commit

Permalink
Adjust right-click deselect from down to up to preserve right-click +…
Browse files Browse the repository at this point in the history
… scroll functionality. (#2511)
  • Loading branch information
lededev authored Nov 3, 2024
1 parent 2d7e9b5 commit 13ed9a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions Src/MergeEditView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ BEGIN_MESSAGE_MAP(CMergeEditView, CCrystalEditViewEx)
ON_WM_TIMER()
ON_WM_LBUTTONDBLCLK()
ON_WM_LBUTTONUP()
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_WM_VSCROLL ()
ON_WM_HSCROLL ()
ON_WM_SIZE()
Expand Down Expand Up @@ -1931,13 +1931,17 @@ void CMergeEditView::OnLButtonUp(UINT nFlags, CPoint point)
/**
* @brief Called when mouse right button is pressed.
*
* If right button is pressed outside diffs, current diff
* If right button is pressed outside diffs, and it is not
* right button + wheel scrolling combination, current diff
* is deselected.
*/
void CMergeEditView::OnRButtonDown(UINT nFlags, CPoint point)
void CMergeEditView::OnRButtonUp(UINT nFlags, CPoint point)
{
CCrystalEditViewEx::OnRButtonDown(nFlags, point);
DeselectDiffIfCursorNotInCurrentDiff();
if (!CMouseHook::IsRightWheelScrolling())
{
DeselectDiffIfCursorNotInCurrentDiff();
}
CCrystalEditViewEx::OnRButtonUp(nFlags, point);
}

void CMergeEditView::OnX2Y(int srcPane, int dstPane, bool selectedLineOnly)
Expand Down
2 changes: 1 addition & 1 deletion Src/MergeEditView.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class CMergeEditView : public CGhostTextView
afx_msg void OnUpdatePrevdiffRO(CCmdUI* pCmdUI);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnAllLeft();
afx_msg void OnUpdateAllLeft(CCmdUI* pCmdUI);
afx_msg void OnAllRight();
Expand Down

0 comments on commit 13ed9a0

Please sign in to comment.