Extract std::vector<SelectionRange *> selPtrs; building code from Editor::InsertCharacter() as Selection::SortedRanges(), and reuse it for Editor::CopySelectionRange() to make copied text for multiple selections sorted ([feature-requests:#1530]).
This change (eliminated one std::sort()) makes msvc x64 Scintilla.dll 4KB smaller.
This includes both implementation changes and a behavioural change.
The change in behaviour stops the user being able to control the order in which a set of items is copied to the clipboard. This may be seen as a regression in functionality.
Renamed to
OrderedRanges(bool sorted)and keep currentCopySelectionRange()behavior.