diff --git a/nvm.sh b/nvm.sh index 69d2f6dfa53..c83ebaafe1c 100644 --- a/nvm.sh +++ b/nvm.sh @@ -1760,9 +1760,7 @@ BEGIN { 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 && !is_installed) { + if (comp(version, min_ver) >= 0) { + filter = 0; + } else { + continue; + } + } + fmt_version = "%15s"; if (version == current) { fmt_version = fmt_current;