From 4b24977217e550a96fe3cb754e5af50a5f3ac814 Mon Sep 17 00:00:00 2001 From: Nico Madysa Date: Tue, 23 Jul 2024 14:05:52 +0200 Subject: [PATCH] fix: type error in case `config.bindings = false`. --- lua/org-roam/setup/keybindings.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/org-roam/setup/keybindings.lua b/lua/org-roam/setup/keybindings.lua index 6b8ecf5..57a5019 100644 --- a/lua/org-roam/setup/keybindings.lua +++ b/lua/org-roam/setup/keybindings.lua @@ -85,9 +85,9 @@ end ---@param roam OrgRoam local function assign_core_keybindings(roam) - -- User can remove all bindings by setting this to nil + -- User can remove all bindings by setting this to false local bindings = roam.config.bindings or {} - local prefix = roam.config.bindings.prefix + local prefix = bindings.prefix assign(bindings.add_alias, "Adds an alias to the roam node under cursor", function() roam.api.add_alias() @@ -222,9 +222,10 @@ end ---@param roam OrgRoam local function assign_dailies_keybindings(roam) - -- User can remove all bindings by setting this to nil + -- User can remove all bindings by setting this to false local bindings = roam.config.extensions.dailies.bindings or {} - local prefix = roam.config.bindings.prefix + local core_bindings = roam.config.bindings or {} + local prefix = core_bindings.prefix assign(bindings.capture_date, "Capture a specific date's note", function() roam.ext.dailies.capture_date()