diff --git a/lua/2048/highlights.lua b/lua/2048/highlights.lua index 5502b61..3099161 100644 --- a/lua/2048/highlights.lua +++ b/lua/2048/highlights.lua @@ -15,11 +15,6 @@ function Highlights.setup() vim.api.nvim_set_hl(ns_id, "2048_Value1024", { fg = "#ffffff", bg = "#edc53f", bold = true }) vim.api.nvim_set_hl(ns_id, "2048_Value2048", { fg = "#ffffff", bg = "#edc22e", bold = true }) vim.api.nvim_set_hl(ns_id, "2048_Value4096", { fg = "#ffffff", bg = "#000000", bold = true }) - vim.api.nvim_set_hl(ns_id, "2048_Value8192", { fg = "#ffffff", bg = "#000000", bold = true }) - vim.api.nvim_set_hl(ns_id, "2048_Value16384", { fg = "#ffffff", bg = "#000000", bold = true }) - vim.api.nvim_set_hl(ns_id, "2048_Value32768", { fg = "#ffffff", bg = "#000000", bold = true }) - vim.api.nvim_set_hl(ns_id, "2048_Value65536", { fg = "#ffffff", bg = "#000000", bold = true }) - vim.api.nvim_set_hl(ns_id, "2048_Value131072", { fg = "#ffffff", bg = "#000000", bold = true }) vim.api.nvim_set_hl(ns_id, "2048_Background", { fg = "#aa9c8f", bg = "#aa9c8f", bold = true }) vim.api.nvim_set_hl(ns_id, "2048_Confirmation", { fg = "#ffffff", bg = "#aa9c8f", bold = true }) end diff --git a/lua/2048/init.lua b/lua/2048/init.lua index 343d7f9..11516a8 100644 --- a/lua/2048/init.lua +++ b/lua/2048/init.lua @@ -689,7 +689,8 @@ function M:draw_square(x, y, i, j, _use_prev_state) else value = self.cs.values[i][j] end - local hl_grp = "2048_Value" .. tostring(value) + value = math.min(value, 4096) + local hl_grp = string.format("2048_Value%s", tonumber(value)) for k = 0, self._square_height - 1 do vim.api.nvim_buf_add_highlight( self.bufnr,