fix: Remove tab completion caching of source (#4893)

This commit is contained in:
Daniel Sage
2023-10-13 05:43:16 -04:00
committed by GitHub
parent 653a14c76b
commit b85d666b32
3 changed files with 2 additions and 10 deletions
+1 -1
View File
@@ -32,7 +32,7 @@
- Dev: Refactor `Image` & Image's `Frames`. (#4773) - Dev: Refactor `Image` & Image's `Frames`. (#4773)
- Dev: Add `WindowManager::getLastSelectedWindow()` to replace `getMainWindow()`. (#4816) - Dev: Add `WindowManager::getLastSelectedWindow()` to replace `getMainWindow()`. (#4816)
- Dev: Clarify signal connection lifetimes where applicable. (#4818) - 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: Fixed flickering when running with Direct2D on Windows. (#4851)
- Dev: Fix qtkeychain include for Qt6 users. (#4863) - 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) - Dev: Add a compile-time flag `CHATTERINO_UPDATER` which can be turned off to disable update checks. (#4854)
@@ -39,18 +39,11 @@ void TabCompletionModel::updateSourceFromQuery(const QString &query)
if (!deducedKind) if (!deducedKind)
{ {
// unable to determine what kind of completion is occurring // unable to determine what kind of completion is occurring
this->sourceKind_ = std::nullopt;
this->source_ = nullptr; this->source_ = nullptr;
return; return;
} }
if (this->sourceKind_ == *deducedKind) // Build source for new query
{
// Source already properly configured
return;
}
this->sourceKind_ = *deducedKind;
this->source_ = this->buildSource(*deducedKind); this->source_ = this->buildSource(*deducedKind);
} }
@@ -64,7 +64,6 @@ private:
Channel &channel_; Channel &channel_;
std::unique_ptr<completion::Source> source_{}; std::unique_ptr<completion::Source> source_{};
std::optional<SourceKind> sourceKind_{};
}; };
} // namespace chatterino } // namespace chatterino