feat(editor): select line on CodeMirror line number gutter click#2052
Conversation
Greptile SummaryThis PR adds line-number gutter click selection to the CodeMirror editor, wiring a new Confidence Score: 5/5Safe to merge; all remaining findings are P2 style/UX suggestions that do not block correct behavior. All P0/P1 concerns from prior rounds are resolved. The two open items are a minor cursor-position UX inconsistency in the downward shift-extend path and a trivial redundant wrapper — neither causes incorrect data or a broken user path. src/cm/lineNumberSelection.ts — Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Gutter click event] --> B{button === 0?}
B -- No --> Z[ignore]
B -- Yes --> C{alt / ctrl / meta?}
C -- Yes --> Z
C -- No --> D[getLineSelectionRange]
D --> E{range resolved?}
E -- No --> Z
E -- Yes --> F{shiftKey?}
F -- No --> G[createLineSelection\nanchor=to, head=from\ncursor at line start]
F -- Yes --> H[createExtendedLineSelection\nmerge current + clicked range]
H --> I{clicked above\ncurrent?}
I -- Yes --> J[single to, from\ncursor at start]
I -- No --> K[single from, to\ncursor past newline ⚠️]
G --> L[view.dispatch + view.focus]
J --> L
K --> L
Reviews (2): Last reviewed commit: "fix" | Re-trigger Greptile |
No description provided.