If all plugins are up-to-date the on_close callback is never run and the MasonToolsUpdateCompleted autocmd is never executed. Calling the on_close function instead of just incrementing the number of completed updates guarantees that, regardless of whether the do_install function is called or not, the autocmd will be executed once we loop through all packages.
If all plugins are up-to-date the
on_close
callback is never run and theMasonToolsUpdateCompleted
autocmd is never executed. Calling theon_close
function instead of just incrementing the number of completed updates guarantees that, regardless of whether thedo_install
function is called or not, the autocmd will be executed once we loop through all packages.