From 629b37b4e115eb502a18e2ced691e3f7340d4c51 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Thu, 30 May 2024 22:44:56 +0200 Subject: [PATCH] fix(sync/ui): progess ui displayed forever (#360) --- lua/rocks/operations/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/rocks/operations/init.lua b/lua/rocks/operations/init.lua index 875b1b57..669edee1 100644 --- a/lua/rocks/operations/init.lua +++ b/lua/rocks/operations/init.lua @@ -333,6 +333,20 @@ operations.sync = function(user_rocks, on_complete) if config.generate_help_pages then vim.cmd("helptags ALL") end + if not vim.tbl_isempty(error_handles) then + local message = "Sync completed with errors! Run ':Rocks log' for details." + log.error(message) + progress_handle:report({ + title = "Error", + message = message, + }) + progress_handle:cancel() + for _, error_handle in pairs(error_handles) do + error_handle:cancel() + end + else + progress_handle:finish() + end if on_complete then on_complete() end