Skip to content
← All reviews
zed-industries/zed #61045 · saberoueslati · 4mo ago

editor: Fix Shift-click selection after cursor movement

Needs attention2 findings · openOpen the pull request on GitHub ↗
Panel verdict

The panel surfaced issues that deserve attention before merge.

2
raised by reviewers
2
kept by the panel

Findings

HighCorrectnessconfidence 0.85

move_offsets_with does not reset select_mode

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.

MediumCorrectnessconfidence 0.80

move_with resets select_mode unconditionally

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; }

3 reviewers · deepseek/deepseek-v4-flash · reviewed in 1m 11s · 3 files, +113 −5

Ship the PR.
Skip the noise.

Free on 2 repositories · No credit card · Advisory only—never blocks a merge