Skip to content

Commit e029960

Browse files
committed
chore(icons): deprecate emoji icons in favor of nerdfonts
1 parent a2608f5 commit e029960

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ require('opencode').setup({
170170
display_cost = true, -- Display cost in the footer
171171
window_highlight = 'Normal:OpencodeBackground,FloatBorder:OpencodeBorder', -- Highlight group for the opencode window
172172
icons = {
173-
preset = 'emoji', -- 'emoji' | 'text'. Choose UI icon style (default: 'emoji')
173+
preset = 'nerdfonts', -- 'nerdfonts' | 'text'. Choose UI icon style (default: 'nerdfonts')
174174
overrides = {}, -- Optional per-key overrides, see section below
175175
},
176176
output = {

lua/opencode/types.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
---@field display_context_size boolean
9797
---@field display_cost boolean
9898
---@field window_highlight string
99-
---@field icons { preset: 'emoji'|'text'|'nerdfonts', overrides: table<string,string> }
99+
---@field icons { preset: 'text'|'nerdfonts', overrides: table<string,string> }
100100
---@field loading_animation OpencodeLoadingAnimationConfig
101101
---@field output OpencodeUIOutputConfig
102102
---@field input { text: { wrap: boolean } }

lua/opencode/ui/icons.lua

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,30 @@ local presets = {
102102
},
103103
}
104104

105+
local deprecated_warning_shown = false
106+
107+
local deprecated_warning_shown = false
108+
105109
---Get icon by key, honoring preset and user overrides
106110
---@param key string
107111
---@return string
108112
function M.get(key)
109113
local ui = (config.ui or {})
110114
local icons_cfg = ui.icons or {}
111-
local preset_name = icons_cfg.preset or 'emoji'
115+
if icons_cfg.preset == 'emoji' then
116+
icons_cfg.preset = nil
117+
if not deprecated_warning_shown then
118+
vim.schedule(function()
119+
vim.notify(
120+
"[opencode] 'emoji' preset is deprecated. Using 'nerdfonts' preset instead. Please update your configuration.",
121+
vim.log.levels.WARN,
122+
{ title = 'Opencode' }
123+
)
124+
end)
125+
deprecated_warning_shown = true
126+
end
127+
end
128+
local preset_name = icons_cfg.preset or 'nerdfonts'
112129
local preset = presets[preset_name] or presets.emoji
113130

114131
-- user overrides table: icons = { overrides = { key = 'value' } }

0 commit comments

Comments
 (0)