jakewvincent/mkdnflow.nvim

Bug: Pressing <S-Tab> in INSERT mode on list item results in `Error executing Lua callback: stack overflow`

Opened this issue · 0 comments

Bug description
There are situations where pressing results in a stack overflow.
This happens while being in INSERT mode and at the start of a list item, but only if there is a todo list item above it in the same list.

So for example, having a markdown file with the following content will result in the error.

- [ ] This is a todo item
- |

  ^
  |
  |
  This vertical bar is the cursor position

This does sometimes result in an error (did not find a way to reproduce this properly yet):

- [ ] This is a todo item
- This is a list item
- |

This does work as expected:

- [ ] This is a todo item

Some other content

- |

Reproduction steps
Steps to reproduce the behavior:

  1. Open a markdown file
  2. Copy the example content snippet from the bug description above
  3. Remove the vertical bar and place your cursor where it was
  4. Enter INSERT mode
  5. Press Shift and Tab

Expected behavior
A tab should be inserted and no error should be thrown.

Error output and/or screenshots

Error executing Lua callback: stack overflow                                                                                                                                                                                                                  
stack traceback:                                                                                                                                                                                                                                              
        [C]: in function 'nvim_buf_get_lines'                                                                                                                                                                                                                 
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:335: in function 'which_cell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:381: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...                                                                                                                                                                                                                                                   
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ...al/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/tables.lua:389: in function 'moveToCell'                                                                                                                                                             
        ....local/share/nvim/lazy/mkdnflow.nvim/plugin/mkdnflow.lua:128: in function <....local/share/nvim/lazy/mkdnflow.nvim/plugin/mkdnflow.lua:127>

Context

  • OS: Arch Linux on Kernel 6.11.5-arch1-1
  • Neovim version: v0.10.2
  • Package manager: Lazy.nvim