jakewvincent / mkdnflow.nvim

Fluent navigation and management of markdown notebooks
GNU General Public License v3.0
654 stars 37 forks source link

Bug: Jumping to the next cell or row not working when the cursor is on the last character of a cell #212

Closed jakewvincent closed 2 months ago

jakewvincent commented 2 months ago

Suppose the cursor is where the _ character is:

| col1 | col2 | col3 |
| ---- | ---- | ---- |
| data |     _|      |
|      |      |      |

If in insert mode with the character in that position, then hitting <CR> or <Tab> will cause unexpected behavior. If <Tab> is hit, the cursor jumps to the first cell in the cursor row. If <CR> is hit, this error is thrown:

Error executing Lua callback: ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:417: attempt to perform arithmetic on local 'cell_start' (a nil value)
stack traceback:
    ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:417: in function 'moveToCell'
    .../share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/wrappers.lua:34: in function 'newListItemOrNextTableRow'
    .../share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/wrappers.lua:100: in function 'multiFuncEnter'
    ....local/share/nvim/lazy/mkdnflow.nvim/plugin/mkdnflow.lua:35: in function <....local/share/nvim/lazy/mkdnflow.nvim/plugin/mkdnflow.lua:31>