From 96631049eba0704d178073b90865f2335d8c50f9 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 24 Mar 2022 10:55:17 +0800 Subject: [PATCH] - fix: goto declaration by ctrl+click will incorrectly select contents --- NEWS.md | 1 + RedPandaIDE/qsynedit/SynEdit.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 75eeb84f..845b6f60 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,7 @@ Red Panda C++ Version 1.0.1 - enhancement: slightly reduce memory usage for code parser - enhancement: switch capslock won't cancel code completion - enhancement: double click on item in code completion list will use it to complete + - fix: goto declaration by ctrl+click will incorrectly select contents Red Panda C++ Version 1.0.0 - fix: calculation for code snippets's tab stop positions is not correct diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index ff689dcf..85b466b3 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -1824,6 +1824,9 @@ void SynEdit::doMouseScroll(bool isDragging) mDropped=false; return; } + Qt::MouseButtons buttons = qApp->mouseButtons(); + if (!buttons.testFlag(Qt::LeftButton)) + return; QPoint iMousePos; DisplayCoord C; int X, Y; @@ -2532,9 +2535,6 @@ void SynEdit::computeScroll(bool isDragging) int X=iMousePos.x(); int Y=iMousePos.y(); - Qt::MouseButtons buttons = qApp->mouseButtons(); - if (!buttons.testFlag(Qt::LeftButton)) - return; QRect iScrollBounds; // relative to the client area int dispX=2,dispY = 2; // if (isDragging) {