From 82354327e5f7dd075b2aec98c9dbdad9cd7390df Mon Sep 17 00:00:00 2001 From: mmb L Date: Sat, 29 Feb 2020 18:52:49 +0800 Subject: [PATCH] Add option for username tab completion only with an @ prefix (#1573) * add an additional check for username completion without an @ prefix * Changed setting name * default userCompletionOnlyWithAt to false --- src/common/CompletionModel.cpp | 2 +- src/singletons/Settings.hpp | 2 ++ src/widgets/settingspages/GeneralPage.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/CompletionModel.cpp b/src/common/CompletionModel.cpp index 6cb3bc80..f3d368da 100644 --- a/src/common/CompletionModel.cpp +++ b/src/common/CompletionModel.cpp @@ -127,7 +127,7 @@ void CompletionModel::refresh(const QString &prefix, bool isFirstWord) TaggedString::Type::Username); } } - else + else if (!getSettings()->userCompletionOnlyWithAt) { for (const auto &name : usernames->subrange(Prefix(usernamePrefix))) diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index cb5613ef..e6d97504 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -134,6 +134,8 @@ public: "/behaviour/autocompletion/smallStreamerLimit", 1000}; BoolSetting prefixOnlyEmoteCompletion = { "/behaviour/autocompletion/prefixOnlyCompletion", true}; + BoolSetting userCompletionOnlyWithAt = { + "/behaviour/autocompletion/userCompletionOnlyWithAt", false}; FloatSetting pauseOnHoverDuration = {"/behaviour/pauseOnHoverDuration", 0}; EnumSetting pauseChatModifier = { diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index d891d085..d0cf636e 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -525,6 +525,8 @@ void GeneralPage::initLayout(SettingsLayout &layout) layout.addCheckbox( "Only search for emote autocompletion at the start of emote names", s.prefixOnlyEmoteCompletion); + layout.addCheckbox("Only search for username autocompletion with an @", + s.userCompletionOnlyWithAt); layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers); layout.addCheckbox("Highlight received inline whispers",