diff --git a/src/expand.cpp b/src/expand.cpp index aa91f3d4b..55720c951 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -1191,12 +1191,6 @@ maybe_t expand_abbreviation(const wcstring &src, const environment_t & return none(); } -maybe_t expand_abbreviation(const wcstring &src) { - // FIXME: We use the principal environment stack because we don't know which variables need to - // be captured in a snapshot. - return expand_abbreviation(src, env_stack_t::principal()); -} - std::map get_abbreviations(const environment_t &vars) { // TODO: try to make this cheaper const size_t fish_abbr_len = std::wcslen(L"_fish_abbr_"); diff --git a/src/expand.h b/src/expand.h index 84500c37e..3970ae0b2 100644 --- a/src/expand.h +++ b/src/expand.h @@ -162,7 +162,6 @@ wcstring replace_home_directory_with_tilde(const wcstring &str, const environmen /// Abbreviation support. Expand src as an abbreviation, returning the expanded form if found, /// none() if not. maybe_t expand_abbreviation(const wcstring &src, const environment_t &vars); -maybe_t expand_abbreviation(const wcstring &src); /// \return a snapshot of all abbreviations as a map abbreviation->expansion. std::map get_abbreviations(const environment_t &vars); diff --git a/src/highlight.cpp b/src/highlight.cpp index bea5a6dc5..f9e9ea158 100644 --- a/src/highlight.cpp +++ b/src/highlight.cpp @@ -1100,7 +1100,7 @@ static bool command_is_valid(const wcstring &cmd, enum parse_statement_decoratio if (!is_valid && function_ok) is_valid = function_exists_no_autoload(cmd, vars); // Abbreviations - if (!is_valid && abbreviation_ok) is_valid = expand_abbreviation(cmd).has_value(); + if (!is_valid && abbreviation_ok) is_valid = expand_abbreviation(cmd, vars).has_value(); // Regular commands if (!is_valid && command_ok) is_valid = path_get_path(cmd, NULL, vars);