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
Open a new markdown file
Add an OL item on the first line:
lorem
~
~
~
Run any Mkdn command that generates a new list item
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>
The Issue
For ordered lists only (it seems), the
update_numbering
function fails when thenewListItem
function is called if the ordered list begins on the first line of the file.Steps to Reproduce
Mkdn
command that generates a new list item