Skip to content

Commit b9b74f8

Browse files
committed
fix: skip extractor loading in infer for non-composable keys
When infer motions receive non-composable keys like dd, di, da (and their y/c variants), no composable motion populates the extractor field. module_loader.get_modules() was still requesting "extractor", falling back to "default" which doesn't exist, logging a spurious error. Only request the extractor module when a composable motion has actually set it. The fallback path at line 103+ already handles non-composable keys gracefully.
1 parent f96a923 commit b9b74f8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lua/smart-motion/core/engine/infer.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ function M.run(ctx, cfg, motion_state)
8888
end
8989
end
9090

91-
local modules = module_loader.get_modules(ctx, cfg, motion_state, { "extractor", "action", "visualizer", "filter" })
91+
-- Only request extractor if a composable motion populated it; otherwise the
92+
-- fallback at line 103+ handles non-composable keys (dd, di, da, etc.) and
93+
-- requesting it here would log a spurious "extractor 'default' not found" error.
94+
local infer_keys = { "action", "visualizer", "filter" }
95+
if motion_state.motion.extractor then
96+
table.insert(infer_keys, 1, "extractor")
97+
end
98+
local modules = module_loader.get_modules(ctx, cfg, motion_state, infer_keys)
9299

93100
-- Merge inferred module metadata into motion_state (setup.run merged metadata for the
94101
-- original motion, but infer may have overridden extractor/visualizer/filter/action)

0 commit comments

Comments
 (0)