Skip to content

Commit

Permalink
Fix regex pattern (only look for whitespace @ beginning of line); add…
Browse files Browse the repository at this point in the history
…resses issue #45
  • Loading branch information
jakewvincent committed May 29, 2022
1 parent 6f99b48 commit 5b1bb4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/mkdnflow/lists.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ local update_parent_to_do = function() end

update_parent_to_do = function(line, row, symbol)
-- See if there's any whitespace before the bullet
local is_indented = line:match('(%s+)[-*]')
local is_indented = line:match('^(%s+)[-*]')
-- If the current to-do is indented, it may have a parent to-do
if is_indented then
local start = row - 2
Expand All @@ -172,7 +172,7 @@ update_parent_to_do = function(line, row, symbol)
-- If there's a to-do on the prev line, see if it's less indented
local has_to_do = get_status(prev_line[1])
if has_to_do then
local indentation = prev_line[1]:match('(%s*)[-*]')
local indentation = prev_line[1]:match('^(%s*)[-*]')
parent = #indentation < #is_indented
else
parent = nil
Expand Down

0 comments on commit 5b1bb4a

Please sign in to comment.