diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index ac40f782..0caa288f 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -2403,7 +2403,9 @@ void ScintillaEditView::convertSelectedTextTo(bool Case) } ::WideCharToMultiByte(codepage, 0, selectedStrW, strWSize, selectedStr, strSize, NULL, NULL); - execute(SCI_REPLACESEL, strSize, (LPARAM)selectedStr); + execute(SCI_SETTARGETSTART, selectionStart); + execute(SCI_SETTARGETEND, selectionEnd); + execute(SCI_REPLACETARGET, strSize - 1, (LPARAM)selectedStr); execute(SCI_SETSEL, selectionStart, selectionEnd); delete [] selectedStr; delete [] selectedStrW;