Skip to content

Commit 7290330

Browse files
committed
Fix failing test & ExpandSelectionToWord
1 parent 4764653 commit 7290330

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/cascadia/TerminalCore/TerminalSelection.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ void Terminal::ExpandSelectionToWord()
409409
const auto& buffer = _activeBuffer();
410410
auto selection{ _selection.write() };
411411
wil::hide_name _selection;
412-
selection->start = buffer.GetWordStart(selection->start, _wordDelimiters);
412+
selection->start = buffer.GetWordStart2(selection->start, _wordDelimiters, false);
413413
selection->pivot = selection->start;
414-
selection->end = buffer.GetWordEnd(selection->end, _wordDelimiters);
414+
selection->end = buffer.GetWordEnd2(selection->end, _wordDelimiters, false);
415415

416416
// if we're targeting both endpoints, instead just target "end"
417417
if (WI_IsFlagSet(_selectionEndpoint, SelectionEndpoint::Start) && WI_IsFlagSet(_selectionEndpoint, SelectionEndpoint::End))

src/host/selection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void Selection::_RegenerateSelectionSpans() const
5555
const auto blockSelection = !IsLineSelection();
5656
const auto& buffer = screenInfo.GetTextBuffer();
5757
auto startSelectionAnchor = _d->coordSelectionAnchor;
58-
buffer.GetSize().IncrementInExclusiveBounds(startSelectionAnchor.x <= endSelectionAnchor.x ? endSelectionAnchor : startSelectionAnchor);
58+
buffer.GetSize().IncrementInExclusiveBounds(startSelectionAnchor <= endSelectionAnchor ? endSelectionAnchor : startSelectionAnchor);
5959
_lastSelectionSpans = buffer.GetTextSpans(startSelectionAnchor,
6060
endSelectionAnchor,
6161
blockSelection,

src/host/ut_host/SelectionTests.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,16 @@ class SelectionTests
141141
}
142142
}
143143

144-
void VerifyGetSelectionSpans_LineMode(const til::point start, const til::point end)
144+
void VerifyGetSelectionSpans_LineMode(const til::point inclusiveStart, const til::point inclusiveEnd)
145145
{
146146
const auto selectionSpans = m_pSelection->GetSelectionSpans();
147147

148148
if (VERIFY_ARE_EQUAL(1u, selectionSpans.size()))
149149
{
150150
auto& span{ selectionSpans[0] };
151-
VERIFY_ARE_EQUAL(start, span.start, L"start");
151+
VERIFY_ARE_EQUAL(inclusiveStart, span.start, L"start");
152152

153-
const til::point exclusiveEnd{ end.x + 1, end.y };
153+
const til::point exclusiveEnd{ inclusiveEnd.x + 1, inclusiveEnd.y };
154154
VERIFY_ARE_EQUAL(exclusiveEnd, span.end, L"end");
155155
}
156156
}

0 commit comments

Comments
 (0)