From 2f1f030908831ae247c8cde26f081482a52f9c15 Mon Sep 17 00:00:00 2001 From: Bryan Date: Mon, 21 Oct 2024 22:18:16 -0600 Subject: [PATCH] Debugging --- lua/in-and-out/init.lua | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/lua/in-and-out/init.lua b/lua/in-and-out/init.lua index 5bf4f4c..fa99cca 100644 --- a/lua/in-and-out/init.lua +++ b/lua/in-and-out/init.lua @@ -63,19 +63,20 @@ function M.in_and_out() end function M.in_and_out_cmd() - local current_pos = vim.fn.getcmdpos() - local target_pos = nil - local line = vim.fn.getcmdline() - vim.notify(current_pos .. line) - for _, char in ipairs(targets) do - local found_pos = string.find(line, escape_lua_pattern(char), current_pos + 1) - if found_pos and (not target_pos or found_pos < target_pos) then - -- If char is a multibyte character, we need to take into account the extra bytes. - target_pos = found_pos + vim.fn.strlen(char) - 1 - end - end - if target_pos then - vim.fn.setcmdpos(target_pos) - end + -- local current_pos = vim.fn.getcmdpos() + -- local target_pos = nil + -- local line = vim.fn.getcmdline() + -- vim.notify(current_pos .. line) + -- for _, char in ipairs(targets) do + -- local found_pos = string.find(line, escape_lua_pattern(char), current_pos + 1) + -- if found_pos and (not target_pos or found_pos < target_pos) then + -- -- If char is a multibyte character, we need to take into account the extra bytes. + -- target_pos = found_pos + vim.fn.strlen(char) - 1 + -- end + -- end + -- if target_pos then + -- vim.fn.setcmdpos(target_pos) + -- end + vim.api.setcmdpos(1) end return M