jakewvincent/mkdnflow.nvim

newListItem Fails for Ordered List on First Line of File

roman1267 opened this issue · 1 comments

The Issue

For ordered lists only (it seems), the update_numbering function fails when the newListItem function is called if the ordered list begins on the first line of the file.

Steps to Reproduce

  1. Open a new markdown file
  2. Add an OL item on the first line:
1. lorem
~
~
~
  1. Run any Mkdn command that generates a new list item
  2. This error and stack trace will appear:
Error executing Lua callback: ...cal/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/lists.lua:170: attempt to index local 'line' (a nil value)
stack traceback:
        ...cal/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/lists.lua:170: in function 'update_numbering'
        ...cal/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/lists.lua:492: in function 'newListItem'
        ....local/share/nvim/lazy/mkdnflow.nvim/plugin/mkdnflow.lua:104: in function <....local/share/nvim/lazy/mkdnflow.nvim/plugin/mkdnflow.lua:103>

@roman1267, thanks for the bug report. This should be fixed in the latest. Please let me know here if it is not.