mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+ fix: in case of "Transform BS", swallow single slashes not related to a ctrl-char
This commit is contained in:
parent
cc729d481d
commit
8fe1536e2e
@ -1961,9 +1961,8 @@ size_t UnSlashA(LPSTR pchInOut, UINT cpEdit)
|
||||
--o;
|
||||
}
|
||||
else {
|
||||
*o = '\\'; // revert
|
||||
++o;
|
||||
*o = *s;
|
||||
//~*o = '\\'; *++o = *s; // revert
|
||||
*o = *s; // swallow single '\'
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2041,8 +2040,8 @@ size_t UnSlashW(LPWSTR pchInOut)
|
||||
--o;
|
||||
}
|
||||
else {
|
||||
*o = '\\'; // revert
|
||||
*++o = *s;
|
||||
//~*o = '\\'; *++o = *s; // revert
|
||||
*o = *s; // swallow single '\'
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2085,17 +2084,20 @@ int CheckRegExReplTarget(char* pszInput)
|
||||
|
||||
void TransformBackslashes(char* pszInput, bool bRegEx, UINT cpEdit, int* iReplaceMsg)
|
||||
{
|
||||
if (bRegEx && iReplaceMsg) {
|
||||
UnSlashLowOctal(pszInput);
|
||||
*iReplaceMsg = CheckRegExReplTarget(pszInput);
|
||||
}
|
||||
else if (iReplaceMsg) {
|
||||
*iReplaceMsg = SCI_REPLACETARGET; // uses SCI std replacement
|
||||
if (iReplaceMsg)
|
||||
{
|
||||
if (bRegEx) {
|
||||
UnSlashLowOctal(pszInput);
|
||||
*iReplaceMsg = CheckRegExReplTarget(pszInput);
|
||||
}
|
||||
else {
|
||||
*iReplaceMsg = SCI_REPLACETARGET; // uses SCI std replacement
|
||||
}
|
||||
}
|
||||
bool const bStdReplace = (iReplaceMsg && (SCI_REPLACETARGET == *iReplaceMsg));
|
||||
|
||||
// regex handles backslashes itself
|
||||
// except: replacement is not delegated to regex engine
|
||||
if (!bRegEx || (iReplaceMsg && (SCI_REPLACETARGET == *iReplaceMsg))) {
|
||||
if (!bRegEx || bStdReplace) {
|
||||
UnSlashA(pszInput, cpEdit);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user