@fresh-editor/fresh-editor 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,10 +87,13 @@ const blameState: BlameState = {
87
87
  // Color Definitions for Header Styling
88
88
  // =============================================================================
89
89
 
90
- const colors = {
91
- headerFg: [0, 0, 0] as [number, number, number], // Black text
92
- headerBg: [200, 200, 200] as [number, number, number], // Light gray background
93
- };
90
+ // Blame headers are rendered via `addVirtualLine`, which accepts theme
91
+ // keys directly so we don't expose colors as plugin settings. Themes
92
+ // drive the look; if a theme lacks specific blame keys, these fall
93
+ // through to the editor's status-bar palette which is what every theme
94
+ // defines.
95
+ const HEADER_FG_KEY = "ui.status_bar_fg";
96
+ const HEADER_BG_KEY = "ui.status_bar_bg";
94
97
 
95
98
  // =============================================================================
96
99
  // Mode Definition
@@ -373,7 +376,8 @@ function addBlameHeaders(): void {
373
376
  // Clear existing headers first
374
377
  editor.clearVirtualTextNamespace(blameState.bufferId, BLAME_NAMESPACE);
375
378
 
376
- // Add a virtual line above each block
379
+ // Add a virtual line above each block. Pass theme keys so the headers
380
+ // restyle automatically when the user switches themes.
377
381
  for (const block of blameState.blocks) {
378
382
  const headerText = formatBlockHeader(block);
379
383
 
@@ -381,7 +385,7 @@ function addBlameHeaders(): void {
381
385
  blameState.bufferId,
382
386
  block.startByte, // anchor position
383
387
  headerText, // text content
384
- { fg: colors.headerFg, bg: colors.headerBg }, // colors (RGB tuples; passing theme key strings would also work)
388
+ { fg: HEADER_FG_KEY, bg: HEADER_BG_KEY },
385
389
  true, // above (LineAbove)
386
390
  BLAME_NAMESPACE, // namespace for bulk removal
387
391
  0 // priority