From 82170b0862f61e3d845aa9da2fae2d8d174fcc7f Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 11 Jan 2019 15:12:17 -0800 Subject: [PATCH] Add HOME as a snapshotted variable Corrects certain autosuggestions involving tildes. --- src/env.cpp | 6 +++--- src/reader.cpp | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/env.cpp b/src/env.cpp index ea921e5e2..15053f1d5 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -1658,10 +1658,10 @@ maybe_t env_vars_snapshot_t::get(const wcstring &key, env_mode_flags_ wcstring_list_t env_vars_snapshot_t::get_names(int flags) const { return names; } const wchar_t *const env_vars_snapshot_t::highlighting_keys[] = { - L"PATH", L"CDPATH", L"fish_function_path", L"PWD", NULL}; + L"PATH", L"CDPATH", L"fish_function_path", L"PWD", L"HOME", NULL}; -const wchar_t *const env_vars_snapshot_t::completing_keys[] = {L"PATH", L"CDPATH", - L"fish_function_path", L"PWD", NULL}; +const wchar_t *const env_vars_snapshot_t::completing_keys[] = { + L"PATH", L"CDPATH", L"fish_function_path", L"PWD", L"HOME", NULL}; #if defined(__APPLE__) || defined(__CYGWIN__) static int check_runtime_path(const char *path) { diff --git a/src/reader.cpp b/src/reader.cpp index 4124aba74..b70576f3d 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1299,7 +1299,6 @@ static std::function get_autosuggestion_performer return [=]() -> autosuggestion_result_t { ASSERT_IS_BACKGROUND_THREAD(); - const autosuggestion_result_t nothing = {}; // If the main thread has moved on, skip all the work. if (generation_count != read_generation_count()) {