Skip to content
PR Quorum
Sign inStart free
← Review gallery
zed-industries/zed #61045openreviewed 6h ago

editor: Fix Shift-click selection after cursor movement

by saberoueslati+113 53 filesreviewed in 1m 11sView PR on GitHub
needs attentionThe panel surfaced issues that deserve attention before merge.2 findings · 1 high+

Reviewer panel

Correctness
deepseek/deepseek-v4-flash
2 found
Security
deepseek/deepseek-v4-flash
0 found
Architecture
deepseek/deepseek-v4-flash
0 found

Findings

01Hhighconf 85%

move_offsets_with does not reset select_mode

crates/editor/src/selections_collection.rs

The fix in move_with resets select_mode to Character after movement, but move_offsets_with (used by move_to_enclosing_bracket, select_delimiters_impl, etc.) does not. This leaves the original bug unfixed for those code paths: after moving the cursor via these methods, Shift-click may still extend from a stale word/line boundary.

02Mmedconf 80%

move_with resets select_mode unconditionally

crates/editor/src/selections_collection.rs:846

move_with resets select_mode to Character regardless of whether the movement actually changed the selection. If the cursor is at a boundary and movement is a no-op (e.g., pressing right at end of line), the mode is still reset. This can break empty line selections that are 'moved' without changing the cursor position, causing subsequent Shift-click to extend character-wise instead of line-wise. The PR description states 'whenever it changes the selection', but the code does not check for change.

Suggested fix

if self.selections_changed { self.collection.select_mode = SelectMode::Character; }

Want this on your own pull requests?
The same reviewer panel runs on every PR — one focused review, no noise.
Start freeLive demo