From 4fc2c4296e612be50f9b4da9969677c8beaf60f4 Mon Sep 17 00:00:00 2001 From: rainzm Date: Tue, 12 Aug 2025 17:07:11 +0800 Subject: [PATCH] fix: correct fallback_call filter logic Incorrect logic causes the function `fallback_call` to always return `fallback_value` when `with_filter` is nil --- lua/codeium/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/codeium/util.lua b/lua/codeium/util.lua index d953a15..a6ca46c 100644 --- a/lua/codeium/util.lua +++ b/lua/codeium/util.lua @@ -6,7 +6,7 @@ local M = {} function M.fallback_call(calls, with_filter, fallback_value) for _, i in ipairs(calls) do local ok, result = pcall(unpack(i)) - if ok and (with_filter ~= nil and with_filter(result)) then + if ok and (with_filter == nil or with_filter(result)) then return result end end