Skip to content

Commit

Permalink
fix: type error in case config.bindings = false.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmadysa committed Jul 23, 2024
1 parent 4515356 commit 4b24977
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua/org-roam/setup/keybindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 4b24977

Please sign in to comment.