Skip to content

Commit

Permalink
fix: v1.8 fixes (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoDean authored Jan 2, 2023
1 parent 5cf3306 commit 8f5d35f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lua/autolist/auto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ local edit_mode = "n"
local M = {}

local function press(key, mode)
if not key or key == "" then return end
local parsed_key = vim.api.nvim_replace_termcodes(key, true, true, true)
if not parsed_key or parsed_key == "" then return end
if mode == "i" then
vim.cmd.normal({ "a" .. parsed_key, bang = true})
else
Expand All @@ -43,13 +43,11 @@ local function checkbox_is_filled(line)
end

local function check_recal(force)
if force == true or vim.tbl_contains(config.recal_function_hooks, func_name) then
if config.recal_full then
recal()
else
recal(utils.get_list_start(fn.line("."), get_lists()))
end
end
if config.recal_full then
recal()
else
recal(utils.get_list_start(fn.line("."), get_lists()))
end
end

local function modify(prev, pattern)
Expand All @@ -71,9 +69,9 @@ local function modify(prev, pattern)
return utils.get_ordered_add(matched, 1)
end

function M.new_before(motion)
function M.new_before(motion, mapping)
new_before_pressed = true
return M.new(motion)
return M.new(motion, mapping)
end

function M.new(motion, mapping)
Expand Down

0 comments on commit 8f5d35f

Please sign in to comment.