fix: use correct non-nil variables (closes #568) (#587)

This commit is contained in:
Anthony Flores 2024-09-15 09:55:08 -05:00 committed by GitHub
parent de9f36fc2f
commit dadf0dc48b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -167,7 +167,7 @@ H.keymaps = function()
) )
end end
if Config.behaviour.auto_suggestion then if Config.behaviour.auto_suggestions then
Utils.safe_keymap_set("i", Config.mappings.suggestion.accept, function() Utils.safe_keymap_set("i", Config.mappings.suggestion.accept, function()
local _, _, sg = M.get() local _, _, sg = M.get()
sg:accept() sg:accept()
@ -371,9 +371,9 @@ M.toggle.hint = H.api(Utils.toggle_wrap({
M.toggle.suggestion = H.api(Utils.toggle_wrap({ M.toggle.suggestion = H.api(Utils.toggle_wrap({
name = "suggestion", name = "suggestion",
get = function() return Config.behaviour.auto_suggestion end, get = function() return Config.behaviour.auto_suggestions end,
set = function(state) set = function(state)
Config.override({ behaviour = { auto_suggestion = state } }) Config.override({ behaviour = { auto_suggestions = state } })
local _, _, sg = M.get() local _, _, sg = M.get()
if state ~= false then if state ~= false then
if sg then sg:setup_autocmds() end if sg then sg:setup_autocmds() end