diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 269d35862..ed0f9cc4a 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -2956,8 +2956,7 @@ void ScintillaEditView::quickSortLines(size_t fromLine, size_t toLine, bool isDe const int startPos = execute(SCI_POSITIONFROMLINE, fromLine); const int endPos = execute(SCI_POSITIONFROMLINE, toLine) + execute(SCI_LINELENGTH, toLine); - - generic_string text = getGenericTextAsString(startPos, endPos); + const generic_string text = getGenericTextAsString(startPos, endPos); std::vector splitText = stringSplit(text, getEOLString()); std::sort(splitText.begin(), splitText.end(), [isDescending](generic_string a, generic_string b) { @@ -2970,7 +2969,7 @@ void ScintillaEditView::quickSortLines(size_t fromLine, size_t toLine, bool isDe return a.compare(b) < 0; } }); - generic_string joined = stringJoin(splitText, getEOLString()); + const generic_string joined = stringJoin(splitText, getEOLString()); replaceTarget(joined.c_str(), startPos, endPos); }