Skip to content

Commit

Permalink
style: stylua (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoDean authored Jan 4, 2023
1 parent b79280e commit 09b60df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
29 changes: 11 additions & 18 deletions lua/autolist/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,18 @@ M.create_mapping_hook = function(mode, mapping, func, alias)
pcall(vim.keymap.del, mode, mapping)
end
end
vim.keymap.set(
mode,
mapping,
function(motion)
local additional_map = nil
if additional_function then
if type(additional_function) == "string" then
local ok, res = pcall(load("return " .. additional_function))
if ok then
additional_map = res or ""
end
else
additional_map = additional_function() or ""
end
vim.keymap.set(mode, mapping, function(motion)
local additional_map = nil
if additional_function then
if type(additional_function) == "string" then
local ok, res = pcall(load("return " .. additional_function))
if ok then additional_map = res or "" end
else
additional_map = additional_function() or ""
end
return func(motion, additional_map or mapping) or ""
end,
{ expr = true, buffer = true }
)
end
return func(motion, additional_map or mapping) or ""
end, { expr = true, buffer = true })
end

return M
3 changes: 2 additions & 1 deletion lua/autolist/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ function M.get_list_start(cur_linenum, list_types)
local cur_indent = M.get_indent_lvl(line)
if cur_indent < 0 then cur_indent = 0 end
if list_types then
while M.is_list(line, list_types)
while
M.is_list(line, list_types)
and M.get_indent_lvl(line) >= cur_indent
do
linenum = linenum - 1
Expand Down

0 comments on commit 09b60df

Please sign in to comment.