Skip to content

Commit 260dc99

Browse files
committed
aha! That's why the .x was there!
1 parent 7290330 commit 260dc99

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/host/selection.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,16 @@ 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 <= endSelectionAnchor ? endSelectionAnchor : startSelectionAnchor);
58+
if (blockSelection)
59+
{
60+
// Compare x-values when we're in block selection!
61+
buffer.GetSize().IncrementInExclusiveBounds(startSelectionAnchor.x <= endSelectionAnchor.x ? endSelectionAnchor : startSelectionAnchor);
62+
}
63+
else
64+
{
65+
// General comparison for line selection.
66+
buffer.GetSize().IncrementInExclusiveBounds(startSelectionAnchor <= endSelectionAnchor ? endSelectionAnchor : startSelectionAnchor);
67+
}
5968
_lastSelectionSpans = buffer.GetTextSpans(startSelectionAnchor,
6069
endSelectionAnchor,
6170
blockSelection,

0 commit comments

Comments
 (0)