Fix crash on "Copy Binary Content" command without selection on edit zone

Fix also an issue that the word where the cursor is on in the edit zone is selected after running ABOUT box, that makes all the occurence of same word highlighted in the edit zone.

Fix #11639, fix 11671, close #11673
pull/11694/head
Shridhar Kumar 2022-05-14 16:08:39 -04:00 committed by Don Ho
parent def3aba4e6
commit df438ea944
1 changed files with 3 additions and 3 deletions

View File

@ -373,7 +373,7 @@ void Notepad_plus::command(int id)
case IDM_EDIT_COPY_BINARY:
case IDM_EDIT_CUT_BINARY:
{
size_t textLen = _pEditView->execute(SCI_GETSELTEXT, 0, 0) - 1;
size_t textLen = _pEditView->execute(SCI_GETSELTEXT, 0, 0);
if (!textLen)
return;
@ -3160,8 +3160,8 @@ void Notepad_plus::command(int id)
{
bool doAboutDlg = false;
const int maxSelLen = 32;
auto textLen = _pEditView->execute(SCI_GETSELTEXT, 0, 0) - 1;
if (!textLen)
auto textLen = _pEditView->execute(SCI_GETSELTEXT, 0, 0);
if (textLen <= 0)
doAboutDlg = true;
if (textLen > maxSelLen)
doAboutDlg = true;