mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Fix "Keep selection when right-click outside of selection" not work issue
Make right-click message handler x-margin calculation right. Previously, the incorrectly used unsigned variable (size_t) overflowed with negative numbers due to incorrect calculation of margin size.x (where possible horizontal scrolling was not taken into account...). Fix #16325, close #16332
This commit is contained in:
parent
6bc7abb021
commit
2ae5df05b9
@ -684,8 +684,8 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
|
||||
bool rightClickKeepsSelection = ((NppParameters::getInstance()).getSVP())._rightClickKeepsSelection;
|
||||
if (rightClickKeepsSelection)
|
||||
{
|
||||
size_t clickX = GET_X_LPARAM(lParam);
|
||||
size_t marginX = execute(SCI_POINTXFROMPOSITION, 0, 0);
|
||||
LONG clickX = GET_X_LPARAM(lParam);
|
||||
LONG marginX = static_cast<LONG>(execute(SCI_POINTXFROMPOSITION, 0, 0)) + static_cast<LONG>(execute(SCI_GETXOFFSET, 0, 0));
|
||||
if (clickX >= marginX)
|
||||
{
|
||||
// if right-click in the editing area (not the margins!),
|
||||
|
Loading…
x
Reference in New Issue
Block a user