From 3c7701d079ae08d4e06686356ea3dd986ea377fb Mon Sep 17 00:00:00 2001 From: hasundue Date: Mon, 4 Mar 2024 16:24:00 +0900 Subject: [PATCH] fix(lua): treat `load_state` as a boolean function This fixes a problem with the Lua example in README.md that `make_state` is called even when `load_state` succeeds. --- lua/dpp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/dpp.lua b/lua/dpp.lua index dbc48d7..6a1f087 100644 --- a/lua/dpp.lua +++ b/lua/dpp.lua @@ -11,7 +11,7 @@ local M = setmetatable({}, { local ret = vim.call('dpp#' .. key, ...) -- NOTE: For boolean functions - if type(ret) ~= 'table' and (vim.startswith(key, 'check_') or vim.startswith(key, 'is_')) then + if type(ret) ~= 'table' and (vim.startswith(key, 'check_') or vim.startswith(key, 'is_')) or key == 'min#load_state' then ret = ret ~= 0 end