[DictQuickLookup] create addQueryWordToFirstResult method (#13911)

So it can be disabled with a userpatch.
This commit is contained in:
David authored and GitHub committed 2025-06-21 11:37:13 +02:00
1 parent d993146480
commit b2f9530788
1 file changed
+11 -6
+11 -6
View File
@@ -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.."<br/>_______<br/>"
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.."<br/>_______<br/>"
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