Skip to content

Commit

Permalink
aha! That's why the .x was there!
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Jan 17, 2025
1 parent 7290330 commit 260dc99
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/host/selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ void Selection::_RegenerateSelectionSpans() const
const auto blockSelection = !IsLineSelection();
const auto& buffer = screenInfo.GetTextBuffer();
auto startSelectionAnchor = _d->coordSelectionAnchor;
buffer.GetSize().IncrementInExclusiveBounds(startSelectionAnchor <= endSelectionAnchor ? endSelectionAnchor : startSelectionAnchor);
if (blockSelection)
{
// Compare x-values when we're in block selection!
buffer.GetSize().IncrementInExclusiveBounds(startSelectionAnchor.x <= endSelectionAnchor.x ? endSelectionAnchor : startSelectionAnchor);
}
else
{
// General comparison for line selection.
buffer.GetSize().IncrementInExclusiveBounds(startSelectionAnchor <= endSelectionAnchor ? endSelectionAnchor : startSelectionAnchor);
}
_lastSelectionSpans = buffer.GetTextSpans(startSelectionAnchor,
endSelectionAnchor,
blockSelection,
Expand Down

0 comments on commit 260dc99

Please sign in to comment.