From b2f9530788b23eee6604ada95f271937259e11f1 Mon Sep 17 00:00:00 2001 From: David <97603719+Commodore64user@users.noreply.github.com> Date: Sat, 21 Jun 2025 10:37:13 +0100 Subject: [PATCH] [DictQuickLookup] create addQueryWordToFirstResult method (#13911) So it can be disabled with a userpatch. --- frontend/ui/widget/dictquicklookup.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/ui/widget/dictquicklookup.lua b/frontend/ui/widget/dictquicklookup.lua index 66e55c31c..e5de1a624 100644 --- a/frontend/ui/widget/dictquicklookup.lua +++ b/frontend/ui/widget/dictquicklookup.lua @@ -1160,12 +1160,7 @@ function DictQuickLookup:changeDictionary(index, skip_update) -- add queried word to 1st result's definition, so we can see -- what was the selected text and if we selected wrong if index == 1 then - if self.is_html then - self.definition = self.definition.."
_______
" - else - self.definition = self.definition.."\n_______\n" - end - self.definition = self.definition..T(_("(query : %1)"), self.word) + self:addQueryWordToResult() end end self.displaydictname = self.dictionary @@ -1188,6 +1183,16 @@ function DictQuickLookup:changeDictionary(index, skip_update) end end +function DictQuickLookup:addQueryWordToResult() + -- Extracted to a separate method so it can be removed by user patches. + if self.is_html then + self.definition = self.definition.."
_______
" + else + self.definition = self.definition.."\n_______\n" + end + self.definition = self.definition..T(_("(query : %1)"), self.word) +end + --[[ No longer used function DictQuickLookup:changeToDefaultDict() if self.dictionary then