mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Add to list of actions that enable multiple carets
Selecting to begin/end of typing pairs or end of line/paragraph will now also break up a column selection into multiple carets.
This commit is contained in:
@@ -874,8 +874,11 @@ namespace ng
|
||||
|
||||
ranges_t extend (buffer_t const& buffer, ranges_t const& selection, select_unit_type const unit, layout_movement_t const* layout)
|
||||
{
|
||||
static std::set<select_unit_type> const splittingUnits = { kSelectionExtendToWord, kSelectionExtendToTypingPair, kSelectionExtendToScope, kSelectionExtendToEndOfSoftLine, kSelectionExtendToEndOfIndentedLine, kSelectionExtendToEndOfLine, kSelectionExtendToEndOfParagraph, kSelectionExtendToBeginOfTypingPair, kSelectionExtendToEndOfTypingPair };
|
||||
bool shouldDissect = splittingUnits.find(unit) != splittingUnits.end();
|
||||
|
||||
ranges_t res;
|
||||
citerate(range, (unit == kSelectionExtendToWord || unit == kSelectionExtendToTypingPair || unit == kSelectionExtendToScope) ? dissect_columnar(buffer, selection) : selection)
|
||||
citerate(range, shouldDissect ? dissect_columnar(buffer, selection) : selection)
|
||||
res.push_back(extend(buffer, *range, unit, layout));
|
||||
return sanitize(buffer, res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user