Fix wrong behavior when selecting to end of line

This also affected a few other selection actions.

Fixes #738.
This commit is contained in:
Allan Odgaard
2013-02-02 08:46:03 +01:00
parent 91d786b2cd
commit 89dccee126

View File

@@ -875,7 +875,8 @@ 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();
bool isColumnar = selection.size() == 1 && selection.last().columnar;
bool shouldDissect = isColumnar && splittingUnits.find(unit) != splittingUnits.end();
ranges_t res;
citerate(range, shouldDissect ? dissect_columnar(buffer, selection) : selection)