mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-12 18:41:01 -06:00
Fix repositioning with the cursor, again (#17141)
This shouldn't have ever worked...? This looks like it was a typo and should have been `mark.end`. Thanks @joadoumie for asking about the moving the cursor in the prompt, that convo lead to me finding this.
This commit is contained in:
parent
41bb28c46d
commit
d14ff939dc
@ -2008,6 +2008,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
selectionNeedsToBeCopied = true;
|
||||
}
|
||||
else if (_settings->RepositionCursorWithMouse()) // This is also mode==Char && !shiftEnabled
|
||||
{
|
||||
_repositionCursorWithMouse(terminalPosition);
|
||||
}
|
||||
_updateSelectionUI();
|
||||
}
|
||||
|
||||
void ControlCore::_repositionCursorWithMouse(const til::point terminalPosition)
|
||||
{
|
||||
// If we're handling a single left click, without shift pressed, and
|
||||
// outside mouse mode, AND the user has RepositionCursorWithMouse turned
|
||||
@ -2054,7 +2061,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// Limit the click to 1 past the last character on the last line.
|
||||
const auto clampedClick = std::min(bufferPos, lastNonSpace);
|
||||
|
||||
if (clampedClick >= end)
|
||||
if (clampedClick >= last.end)
|
||||
{
|
||||
// Get the distance between the cursor and the click, in cells.
|
||||
|
||||
@ -2095,8 +2102,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
}
|
||||
}
|
||||
}
|
||||
_updateSelectionUI();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Updates the renderer's representation of the selection as well as the selection marker overlay in TermControl
|
||||
|
||||
@ -403,6 +403,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void _focusChanged(bool focused);
|
||||
|
||||
void _selectSpan(til::point_span s);
|
||||
void _repositionCursorWithMouse(const til::point terminalPosition);
|
||||
|
||||
void _contextMenuSelectMark(
|
||||
const til::point& pos,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user