diff options
Diffstat (limited to 'scripts/theme-studio/previews.js')
| -rw-r--r-- | scripts/theme-studio/previews.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/theme-studio/previews.js b/scripts/theme-studio/previews.js index cb9d5babe..fef616c40 100644 --- a/scripts/theme-studio/previews.js +++ b/scripts/theme-studio/previews.js @@ -481,3 +481,14 @@ function renderMarkdownPreview(){const a='markdown-mode',L=[]; L.push(os(a,'markdown-html-tag-delimiter-face','<')+os(a,'markdown-html-tag-name-face','kbd')+os(a,'markdown-html-tag-delimiter-face','>')+'Ctrl-C'+os(a,'markdown-html-tag-delimiter-face','</')+os(a,'markdown-html-tag-name-face','kbd')+os(a,'markdown-html-tag-delimiter-face','>')); L.push(os(a,'markdown-footnote-marker-face','[^1]:')+' '+os(a,'markdown-footnote-text-face','the footnote text.')); return previewLines(L);} +// nerd-icons legend preview: each curated filetype's real nerd-font glyph drawn +// in its mapped color face, then the sample name. The legend rides +// APPS['nerd-icons'].legend (captured by build-nerd-icons-legend.el); recoloring +// a face repaints every row mapped to it because os() reads the live registry. +// Falls back to the generic preview if the legend is missing (the bespoke app +// only registers with a valid one, so that path is defensive). +function renderNerdIconsPreview(){ + const a='nerd-icons',rows=(APPS[a]&&APPS[a].legend)||[],L=[]; + if(!rows.length)return genericPreview(a); + for(const r of rows) L.push(os(a,r.face,r.glyph)+' '+r.label); + return previewLines(L);} |
