Skip to content

Commit

Permalink
fix: if sln exists, MaMo should promote it
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Aug 31, 2022
1 parent a440e15 commit 3b53f3c
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/cascadia/TerminalCore/TerminalSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,25 @@ void Terminal::ToggleMarkMode()
// Enter Mark Mode
// NOTE: directly set cursor state. We already should have locked before calling this function.
_activeBuffer().GetCursor().SetIsOn(false);
const auto cursorPos{ _activeBuffer().GetCursor().GetPosition() };
_selection = SelectionAnchors{};
_selection->start = cursorPos;
_selection->end = cursorPos;
_selection->pivot = cursorPos;
_ScrollToPoint(cursorPos);
if (!IsSelectionActive())
{
// No selection --> start one at the cursor
const auto cursorPos{ _activeBuffer().GetCursor().GetPosition() };
_selection = SelectionAnchors{};
_selection->start = cursorPos;
_selection->end = cursorPos;
_selection->pivot = cursorPos;
_blockSelection = false;
WI_SetAllFlags(_selectionEndpoint, SelectionEndpoint::Start | SelectionEndpoint::End);
}
else if (WI_AreAllFlagsClear(_selectionEndpoint, SelectionEndpoint::Start | SelectionEndpoint::End))
{
// Selection already existed
WI_SetFlag(_selectionEndpoint, SelectionEndpoint::End);
}
_ScrollToPoint(_selection->start);
_selectionMode = SelectionInteractionMode::Mark;
_blockSelection = false;
_selectionIsTargetingUrl = false;
WI_SetAllFlags(_selectionEndpoint, SelectionEndpoint::Start | SelectionEndpoint::End);
}
}

Expand Down

0 comments on commit 3b53f3c

Please sign in to comment.