From b85d666b32a8d2bc7dc940a391e1b2322febcd43 Mon Sep 17 00:00:00 2001 From: Daniel Sage <24928223+dnsge@users.noreply.github.com> Date: Fri, 13 Oct 2023 05:43:16 -0400 Subject: [PATCH] fix: Remove tab completion caching of source (#4893) --- CHANGELOG.md | 2 +- src/controllers/completion/TabCompletionModel.cpp | 9 +-------- src/controllers/completion/TabCompletionModel.hpp | 1 - 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b107fb97..99074077f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ - Dev: Refactor `Image` & Image's `Frames`. (#4773) - Dev: Add `WindowManager::getLastSelectedWindow()` to replace `getMainWindow()`. (#4816) - Dev: Clarify signal connection lifetimes where applicable. (#4818) -- Dev: Laid the groundwork for advanced input completion strategies. (#4639, #4846, #4853) +- Dev: Laid the groundwork for advanced input completion strategies. (#4639, #4846, #4853, #4893) - Dev: Fixed flickering when running with Direct2D on Windows. (#4851) - Dev: Fix qtkeychain include for Qt6 users. (#4863) - Dev: Add a compile-time flag `CHATTERINO_UPDATER` which can be turned off to disable update checks. (#4854) diff --git a/src/controllers/completion/TabCompletionModel.cpp b/src/controllers/completion/TabCompletionModel.cpp index a56ea1a59..159e89f3d 100644 --- a/src/controllers/completion/TabCompletionModel.cpp +++ b/src/controllers/completion/TabCompletionModel.cpp @@ -39,18 +39,11 @@ void TabCompletionModel::updateSourceFromQuery(const QString &query) if (!deducedKind) { // unable to determine what kind of completion is occurring - this->sourceKind_ = std::nullopt; this->source_ = nullptr; return; } - if (this->sourceKind_ == *deducedKind) - { - // Source already properly configured - return; - } - - this->sourceKind_ = *deducedKind; + // Build source for new query this->source_ = this->buildSource(*deducedKind); } diff --git a/src/controllers/completion/TabCompletionModel.hpp b/src/controllers/completion/TabCompletionModel.hpp index f274a9944..21e06e3c9 100644 --- a/src/controllers/completion/TabCompletionModel.hpp +++ b/src/controllers/completion/TabCompletionModel.hpp @@ -64,7 +64,6 @@ private: Channel &channel_; std::unique_ptr source_{}; - std::optional sourceKind_{}; }; } // namespace chatterino