newListItem Fails for Ordered List on First Line of File
roman1267 opened this issue · 1 comments
roman1267 commented
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
- Open a new markdown file
- Add an OL item on the first line:
1. 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>
jakewvincent commented
@roman1267, thanks for the bug report. This should be fixed in the latest. Please let me know here if it is not.