Skip to content

Commit

Permalink
timeout() does not exist in the terminal version.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitalquark committed Jul 27, 2023
1 parent 1023fcd commit e534722
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1230,16 +1230,18 @@ end)
-- If the buffer has active diagnostics and has since been modified, ask the server for updated
-- diagnostics.
-- TODO: investigate using textDocument/diagnostic method and response. For now this is passive.
timeout(1, function()
if not buffer._lsp_diagnostic_time or not buffer._lsp_mod_time then return true end
local server = get_server()
if not server then return true end
if buffer._lsp_mod_time > buffer._lsp_diagnostic_time then
server:sync_buffer()
buffer._lsp_mod_time, buffer._lsp_diagnostic_time = nil, nil
end
return true
end)
if not CURSES then
timeout(1, function()
if not buffer._lsp_diagnostic_time or not buffer._lsp_mod_time then return true end
local server = get_server()
if not server then return true end
if buffer._lsp_mod_time > buffer._lsp_diagnostic_time then
server:sync_buffer()
buffer._lsp_mod_time, buffer._lsp_diagnostic_time = nil, nil
end
return true
end)
end

-- Add a menu.
-- (Insert 'Language Server' menu in alphabetical order.)
Expand Down

0 comments on commit e534722

Please sign in to comment.