Skip to content

Fix wrong selection in commit panel#52467

Closed
OmChillure wants to merge 1 commit intozed-industries:mainfrom
OmChillure:fix-wrong-selection-in-commit-panel
Closed

Fix wrong selection in commit panel#52467
OmChillure wants to merge 1 commit intozed-industries:mainfrom
OmChillure:fix-wrong-selection-in-commit-panel

Conversation

@OmChillure
Copy link
Copy Markdown
Contributor

Summary

Fix wrong outline selection at heading boundaries in Markdown files.

When clicking headings in the Outline Panel for Markdown, the selected item showed as N-1 (previous heading) instead of N. Root cause: the outline_location() function's sort key prioritized depth over cursor position, causing deeper sections to win even when the cursor was at the exact start of a shallower section.

Fixes #52418

How to Review

  • outline_panel.rs:3395 : Sort key change adding cursor_past_start as primary criterion
  • outline_panel.rs:8094 : New comprehensive test with 8 boundary/nesting cases

Self-Review Checklist

  • Reviewed diff for quality and correctness
  • Tests cover the new/changed behavior (8 test cases added)
  • No unsafe code changes
  • All 12 tests pass (11 existing + 1 new)

Video

Screencast.from.2026-03-26.09-58-23.webm

Release Notes:

  • Fixed Outline Panel selection being off-by-one at Markdown heading boundaries

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 26, 2026
@zed-community-bot zed-community-bot bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Mar 26, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, as-cii and dinocosta and removed request for a team March 26, 2026 04:29
@maxdeviant maxdeviant changed the title fix wrong selection in commit panel Fix wrong selection in commit panel Mar 26, 2026
@OmChillure OmChillure closed this by deleting the head repository Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong selection in Outline Panel for MD files

3 participants