Skip to content

Commit 9338b3f

Browse files
committed
feat: add hover on achievements
1 parent 382cd0a commit 9338b3f

File tree

5 files changed

+521
-269
lines changed

5 files changed

+521
-269
lines changed

lua/codeme/ui/dashboard.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ function M.show_window(stat_data)
158158

159159
-- Global refresh keymap
160160
local function force_refresh()
161-
backend.get_stats(false, function(stat_data)
162-
stats.set_stats(stat_data)
163-
render_dashboard(stat_data)
161+
backend.get_stats(false, function(new_stat_data)
162+
stats.set_stats(new_stat_data)
163+
render_dashboard(new_stat_data)
164164
trigger_on_enter()
165165
end)
166166
end
@@ -201,6 +201,11 @@ function M.show_window(stat_data)
201201
end
202202

203203
local function close()
204+
local ok, records_tab = pcall(require, "codeme.ui.tabs.records")
205+
if ok and records_tab.teardown_hover then
206+
records_tab.teardown_hover()
207+
end
208+
204209
local win_handle = stats.get_win()
205210
if win_handle and vim.api.nvim_win_is_valid(win_handle) then
206211
vim.api.nvim_win_close(win_handle, true)

lua/codeme/ui/renderer.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
local util = require("codeme.util")
21
local M = {}
32

43
---String width (unicode-aware)

0 commit comments

Comments
 (0)