Skip to content

Commit

Permalink
Reset "Transforms Backslashes" when copy selection as find text, issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Apr 10, 2024
1 parent d1a0f69 commit dd82a7a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -4735,18 +4735,14 @@ static bool CopySelectionAsFindText(HWND hwnd, LPEDITFINDREPLACE lpefr, bool bFi
}

if (StrNotEmptyA(lpszSelection)) {
const UINT cpEdit = SciCall_GetCodePage();
// Check lpszSelection and truncate bad chars
//char *lpsz = strpbrk(lpszSelection, "\r\n\t");
//if (lpsz) {
// *lpsz = '\0';
//}

char *lpszEscSel = (char *)NP2HeapAlloc((2 * NP2_FIND_REPLACE_LIMIT));
if (AddBackslashA(lpszEscSel, lpszSelection)) {
lpefr->bTransformBS = !(lpefr->fuFlags & SCFIND_REGEXP);
} else {
lpefr->bTransformBS = false;
}

const UINT cpEdit = SciCall_GetCodePage();
SetDlgItemTextA2W(cpEdit, hwnd, IDC_FINDTEXT, lpszEscSel);
NP2HeapFree(lpszEscSel);
}
Expand Down

0 comments on commit dd82a7a

Please sign in to comment.