@@ -377,7 +377,6 @@ function TaskQueue:status()
377
377
}
378
378
end
379
379
380
- local task_queue = TaskQueue .new (DEFAULT_SETTINGS .max_concurrent_tasks )
381
380
-- =====================================================================
382
381
-- 4. UI Window
383
382
-- =====================================================================
@@ -457,6 +456,7 @@ function ProgressWindow:open()
457
456
title = self .title ,
458
457
title_pos = ' center' ,
459
458
})
459
+ self .ns = api .nvim_create_namespace (' Strive' )
460
460
461
461
-- Set window options
462
462
vim .wo [self .winid ].wrap = false
@@ -529,7 +529,6 @@ function ProgressWindow:refresh()
529
529
table.insert (lines , string.rep (' =' , width ))
530
530
table.insert (lines , string.format (' %-30s %-10s %s' , ' Plugin' , ' Status' , ' Message' ))
531
531
table.insert (lines , string.rep (' =' , width ))
532
-
533
532
-- Plugin entries
534
533
for _ , name in ipairs (sorted_plugins ) do
535
534
local entry = self .entries [name ]
@@ -544,6 +543,7 @@ function ProgressWindow:refresh()
544
543
api .nvim_buf_set_lines (self .bufnr , 0 , - 1 , false , lines )
545
544
vim .bo [self .bufnr ].modifiable = false
546
545
546
+ vim .hl .range (self .bufnr , self .ns , ' Comment' , { 0 , 0 }, { 2 , - 1 })
547
547
return self
548
548
end
549
549
@@ -1034,17 +1034,24 @@ function Plugin:has_updates()
1034
1034
callback (false )
1035
1035
return
1036
1036
end
1037
+
1037
1038
local path = self :get_path ()
1038
- local cmd = {
1039
+ local fetch_cmd = {
1039
1040
' git' ,
1040
1041
' -C' ,
1041
1042
path ,
1042
1043
' fetch' ,
1043
- ' --dry-run' ,
1044
1044
' --quiet' ,
1045
1045
' origin' ,
1046
- ' HEAD' ,
1047
- ' &&' ,
1046
+ }
1047
+
1048
+ local result = Async .try_await (Async .system (fetch_cmd ))
1049
+ if not result .success then
1050
+ callback (false )
1051
+ return
1052
+ end
1053
+
1054
+ local rev_cmd = {
1048
1055
' git' ,
1049
1056
' -C' ,
1050
1057
path ,
@@ -1053,13 +1060,15 @@ function Plugin:has_updates()
1053
1060
' HEAD..@{upstream}' ,
1054
1061
}
1055
1062
1056
- local result = Async .try_await (Async .system (cmd ))
1063
+ result = Async .try_await (Async .system (rev_cmd ))
1057
1064
if not result .success then
1058
1065
callback (false )
1059
1066
return
1060
1067
end
1061
1068
1062
- local has_updates = result .value .stdout and tonumber (result .value .stdout :match (' %d+' )) > 0
1069
+ local count = tonumber (result .value .stdout and result .value .stdout :match (' %d+' ) or ' 0' )
1070
+ local has_updates = count and count > 0
1071
+
1063
1072
callback (has_updates )
1064
1073
end )()
1065
1074
end
@@ -1304,6 +1313,8 @@ function M.install()
1304
1313
M .log (' info' , string.format (' Installing %d plugins...' , # plugins_to_install ))
1305
1314
ui :open ()
1306
1315
1316
+ local task_queue = TaskQueue .new (DEFAULT_SETTINGS .max_concurrent_tasks )
1317
+
1307
1318
-- Create installation tasks with proper error handling
1308
1319
local install_tasks = {}
1309
1320
for _ , plugin in ipairs (plugins_to_install ) do
0 commit comments