summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/clever_f/motion_executor.lua2
-rw-r--r--tests/run.lua22
2 files changed, 23 insertions, 1 deletions
diff --git a/lua/clever_f/motion_executor.lua b/lua/clever_f/motion_executor.lua
index 198534b..212a362 100644
--- a/lua/clever_f/motion_executor.lua
+++ b/lua/clever_f/motion_executor.lua
@@ -12,7 +12,7 @@ function M.execution_path(context)
if context.visual_kind ~= nil then
return M.ExecutionPath.VISUAL
end
- return nil
+ return M.ExecutionPath.COMMAND
end
return M
diff --git a/tests/run.lua b/tests/run.lua
index 8eeef32..f10aa70 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -3122,6 +3122,28 @@ test("Motion execution routes every Visual kind to the Visual path", function()
end
end)
+test("Motion execution routes non-Visual contexts to the command path", function()
+ local command_modes = {
+ "n",
+ "no",
+ "nov",
+ "noV",
+ "no" .. string.char(0x16),
+ "s",
+ "S",
+ string.char(0x13),
+ "niI",
+ "normal-extension",
+ }
+ for _, mode in ipairs(command_modes) do
+ same(
+ motion_executor.ExecutionPath.COMMAND,
+ motion_executor.execution_path(mode),
+ mode
+ )
+ end
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then