Skip to content

Commit cc67c30

Browse files
committed
PRE-MERGE #20084 Fix rounding error for word selection
2 parents dba14eb + e9a1fe5 commit cc67c30

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/cascadia/TerminalControl/ControlInteractivity.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
309309
const auto isOnOriginalPosition = _lastMouseClickPosNoSelection == pixelPosition;
310310

311311
// Rounded coordinates for text selection.
312-
// Don't round in VT mouse mode; cell-level precision matters more
313-
const auto round = !_core->IsVtMouseModeEnabled();
312+
// Don't round in VT mouse mode; cell-level precision matters more.
313+
// Only round for single-click: for double/triple-click, rounding
314+
// can push the position to the next cell, selecting the wrong word.
315+
const auto round = multiClickMapper == 1 && !_core->IsVtMouseModeEnabled();
314316
_core->LeftClickOnTerminal(_getTerminalPosition(til::point{ pixelPosition }, round),
315317
multiClickMapper,
316318
altEnabled,

0 commit comments

Comments
 (0)