Merge pull request #3501 from chiizujin/duplicate_help

Fix inability to edit, delete (etc.) help topics whose names overlap non-db topic names.
This commit is contained in:
Griatch 2024-04-27 19:40:58 +02:00 committed by GitHub
commit 18a7b9e2c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -932,7 +932,17 @@ class CmdSetHelp(CmdHelp):
# types of entries.
self.msg(f"|rWarning:\n|r{warning}|n")
repl = yield ("|wDo you still want to continue? Y/[N]?|n")
if repl.lower() not in ("y", "yes"):
if repl.lower() in ("y", "yes"):
# find a db-based help entry if one already exists
db_topics = {**db_help_topics}
db_categories = list(
set(HelpCategory(topic.help_category) for topic in db_topics.values())
)
entries = list(db_topics.values()) + db_categories
match, _ = self.do_search(querystr, entries)
if match:
old_entry = match
else:
self.msg("Aborted.")
return
else: