editor: Prevent underlines from appearing in minimap (#48510)

I noticed that the minimap seems to render underlines with the same
thickness as the main editor, which looks a bit off. This becomes much
more noticeable when enabling `semantic_token_rules` (due to the
increased number of underlines):

```json
"global_lsp_settings": {
  "semantic_token_rules": [
    {
      "token_modifiers": ["mutable"],
      "underline": true,
    },
  ],
}
```
Looking at the existing code, I found that diagnostic underlines already
check `editor_style.show_underlines` to ensure they are only displayed
in the main editor. To maintain consistency, I applied the same
filtering logic to `chunk_highlight` so that these underlines are no
longer rendered in the minimap.

Before:
<img alt="CleanShot 2026-02-06 at 02 28 31@2x"
src="https://github.com/user-attachments/assets/16401154-23f5-43ef-a7a8-b1035c19e076"
/>
After:
<img alt="CleanShot 2026-02-06 at 02 31 36@2x"
src="https://github.com/user-attachments/assets/979a04be-e585-44be-9c42-4dfab7b89186"
/>

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ authored and GitHub committed 2026-03-04 11:59:08 +00:00
1 parent 6e07d2a20c
commit 31dcfded35
1 file changed
+3
+3
View File
@@ -1924,6 +1924,9 @@ impl DisplaySnapshot {
color
}
}),
underline: chunk_highlight
.underline
.filter(|_| editor_style.show_underlines),
..chunk_highlight
}
});