()
| 141 | } |
| 142 | |
| 143 | function renderEditorThemes() { |
| 144 | const currentTheme = ( |
| 145 | appSettings.value.editorTheme || "one_dark" |
| 146 | ).toLowerCase(); |
| 147 | if (innerHeight * 0.3 >= 120) { |
| 148 | $page.body.append($themePreview); |
| 149 | createPreview(currentTheme); |
| 150 | } else { |
| 151 | $themePreview.remove(); |
| 152 | } |
| 153 | |
| 154 | const themeList = getThemes(); |
| 155 | let $currentItem; |
| 156 | list.el.content = themeList.map((t) => { |
| 157 | const isCurrent = t.id === currentTheme; |
| 158 | const $item = ( |
| 159 | <Item |
| 160 | name={t.caption} |
| 161 | isCurrent={isCurrent} |
| 162 | swatches={getEditorThemeSwatches(t.id)} |
| 163 | onclick={() => setEditorTheme({ caption: t.caption, theme: t.id })} |
| 164 | /> |
| 165 | ); |
| 166 | if (isCurrent) $currentItem = $item; |
| 167 | return $item; |
| 168 | }); |
| 169 | $currentItem?.scrollIntoView(); |
| 170 | } |
| 171 | |
| 172 | function renderTerminalThemes() { |
| 173 | destroyPreview("switch-tab"); |
nothing calls this directly
no test coverage detected