From 1a777257b43f86f547b2f7b586e28d797eb8227f Mon Sep 17 00:00:00 2001 From: myk002 Date: Fri, 5 Aug 2022 22:06:02 -0700 Subject: [PATCH] add get_entry_types API method to helpdb --- library/lua/helpdb.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/lua/helpdb.lua b/library/lua/helpdb.lua index a23002e57..bfca996eb 100644 --- a/library/lua/helpdb.lua +++ b/library/lua/helpdb.lua @@ -468,6 +468,10 @@ local function get_db_property(entry_name, property) textdb[entrydb[entry_name].text_entry][property] end +function ge_entry_types(entry) + return get_db_property(entry, 'entry_types') +end + -- returns the ~54 char summary blurb associated with the entry function get_entry_short_help(entry) return get_db_property(entry, 'short_help') @@ -637,9 +641,7 @@ function get_commands() end function is_builtin(command) - ensure_db() - return entrydb[command] and - get_db_property(command, 'entry_types')[ENTRY_TYPES.BUILTIN] + return is_entry(command) and get_entry_types(command)[ENTRY_TYPES.BUILTIN] end ---------------------------------------------------------------------------