| 192 | } |
| 193 | |
| 194 | void BetterMultiSelection::SetSelections(const QVector<Selection> &selections) { |
| 195 | for (auto i = 0; i < selections.size(); ++i) { |
| 196 | if (i == 0) |
| 197 | editor->setSelection(selections[i].caret, selections[i].anchor); |
| 198 | else |
| 199 | editor->addSelection(selections[i].caret, selections[i].anchor); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | void BetterMultiSelection::EditSelections(std::function<void(Selection &selection)> edit) { |
| 204 | auto selections = GetSelections(); |