Skip to content

Commit

Permalink
fix(lua): treat load_state as a boolean function
Browse files Browse the repository at this point in the history
This fixes a problem with the Lua example in README.md that `make_state`
is called even when `load_state` succeeds.
  • Loading branch information
hasundue committed Mar 4, 2024
1 parent f732da6 commit 3c7701d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/dpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3c7701d

Please sign in to comment.