Skip to content

Commit a14f9e2

Browse files
committed
Minor cleanup in timer.lua
1 parent af54cfc commit a14f9e2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/lsp-status/timer.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- Timer instance
2-
local timer = nil
1+
local statusline = require('lsp-status/statusline')
2+
33
--- This flag is used to redraw one more time after the last LSP update.
44
-- NOTE: This is achieved by setting the redraw_flag to true if
55
-- vim.g.lsp_status_redraw is true and there has been an update. Next time if
@@ -19,7 +19,7 @@ local function timer_callback()
1919
if update_flag or redraw_flag then
2020
vim.g.lsp_status_redraw = false
2121
-- Schedule the command when it's safe to call it
22-
local new_state = require('lsp-status/statusline').get_lsp_statusline()
22+
local new_state = statusline.get_lsp_statusline()
2323
if new_state ~= vim.g.lsp_status_statusline then
2424
vim.g.lsp_status_statusline = new_state
2525
vim.api.nvim_command('redrawstatus!')
@@ -38,6 +38,8 @@ end
3838
-- set use the variable timer to schedule the updates.
3939
-- TODO: This could error if the lsp is disconnected, the timer should be
4040
-- stopped
41+
--- Timer instance
42+
local timer = nil
4143
local function register_timer()
4244
-- Guard the for an already defined timer
4345
if timer ~= nil then return end

0 commit comments

Comments
 (0)