editor: Refresh active debug line highlight on theme change#59274
Open
Dnreikronos wants to merge 1 commit into
Open
editor: Refresh active debug line highlight on theme change#59274Dnreikronos wants to merge 1 commit into
Dnreikronos wants to merge 1 commit into
Conversation
The active debug line is highlighted with a concrete Hsla captured from the theme when go_to_active_debug_line runs. A theme switch fires theme_changed, which refreshed brackets, semantic tokens, and outline symbols but never re-applied the ActiveDebugLine highlight. While paused at a breakpoint, the debug line kept its stale color until the debugger stepped again or Zed restarted. Re-run go_to_active_debug_line from theme_changed so the highlight tracks the current theme. Covered by a regression test in debugger_ui. Closes zed-industries#58736
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fixes #58736
Pause the debugger on a breakpoint, switch your theme, and the active debug line keeps its old highlight color until you step again or restart Zed.
Solution
The highlight stores a concrete color grabbed from the theme back when
go_to_active_debug_lineran. A theme switch goes throughtheme_changed, which refreshes brackets, semantic tokens, and outline symbols but never re-applies that highlight, so it stays stale. Re-runninggo_to_active_debug_linefromtheme_changedre-resolves the color against the current theme.Testing
Added a regression test in
debugger_uithat stops at a debug line, swaps the theme'seditor.debugger_active_line.background, and checks the highlight follows. It fails onmainand passes with the fix.Also tested by hand on Windows: started a debugpy session, paused at a breakpoint, switched themes from the theme selector, and watched the active line recolor live without stepping or restarting.
Self-Review Checklist:
Showcase
Paused at a breakpoint, switching themes from the theme selector.
Release Notes: