Skip to content

Commit

Permalink
fix: recal didn't check for var nil before using #16
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoDean committed Sep 12, 2022
1 parent c3531cf commit 7ce72c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/autolist/auto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ function M.recal(override_start_num, reset_list)
list_start_num = utils.get_list_start(fn.line("."), types)
reset_list = 0
end
if not list_start_num then return end -- returns nil if not ordered list
if reset_list then
local next_num = list_start_num + reset_list
local nxt = fn.getline(next_num)
if utils.is_ordered(nxt) then
fn.setline(next_num, utils.set_ordered_value(nxt, 1))
end
end
if not list_start_num then return end -- returns nil if not ordered list
local list_start = fn.getline(list_start_num)
local list_indent = utils.get_indent_lvl(list_start)

Expand Down

0 comments on commit 7ce72c3

Please sign in to comment.