diff --git a/nvm.sh b/nvm.sh index 69d2f6dfa53..e24743fb265 100644 --- a/nvm.sh +++ b/nvm.sh @@ -1755,14 +1755,12 @@ BEGIN { split(remote_versions, lines, "|"); split(installed_versions, installed, "|"); rows = alen(lines); - filter = (min_ver != "v0"); + filter_on = (min_ver != "v0"); for (m = n = 1; n <= rows; n++) { split(lines[n], fields, "[[:blank:]]+"); cols = alen(fields); version = fields[1]; - if (filter && comp(version, min_ver) < 0) continue; - filter = 0; is_installed = 0; for (i in installed) { if (version == installed[i]) { @@ -1771,6 +1769,14 @@ BEGIN { } } + if (filter_on && !is_installed) { + if (comp(version, min_ver) >= 0) { + filter_on = 0; + } else { + continue; + } + } + fmt_version = "%15s"; if (version == current) { fmt_version = fmt_current;