MCPcopy Index your code
hub / github.com/codeaashu/claude-code / updateSelection

Function updateSelection

src/ink/selection.ts:100–114  ·  view source on GitHub ↗
(
  s: SelectionState,
  col: number,
  row: number,
)

Source from the content-addressed store, hash-verified

98}
99
100export function updateSelection(
101 s: SelectionState,
102 col: number,
103 row: number,
104): void {
105 if (!s.isDragging) return
106 // First motion at the same cell as anchor is a no-op. Terminals in mode
107 // 1002 can fire a drag event at the anchor cell (sub-pixel tremor, or a
108 // motion-release pair). Setting focus here would turn a bare click into
109 // a 1-cell selection and clobber the clipboard via useCopyOnSelect. Once
110 // focus is set (real drag), we track normally including back to anchor.
111 if (!s.focus && s.anchor && s.anchor.col === col && s.anchor.row === row)
112 return
113 s.focus = { col, row }
114}
115
116export function finishSelection(s: SelectionState): void {
117 s.isDragging = false

Callers 1

handleSelectionDragMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected