joshuadanpeterson / typewriter.nvim

A Neovim plugin that emulates a typewriter, keeping the cursor centered on the screen for a focused writing experience.
MIT License
23 stars 0 forks source link

TWTop & TWBottom not working #8

Closed Rasmus-Bertell closed 1 month ago

Rasmus-Bertell commented 2 months ago

Running either TWTop or TWBottom results in the following error

Error executing Lua callback: ...l/share/nvim/lazy/typewriter/lua/typewriter/commands.lua:141: attempt to call global 'get_expand_r
oot' (a nil value)
stack traceback:
        ...l/share/nvim/lazy/typewriter/lua/typewriter/commands.lua:141: in function 'move_to_top_of_block'
        ...are/nvim/lazy/typewriter/lua/typewriter/autocommands.lua:49: in function <...are/nvim/lazy/typewriter/lua/typewriter/aut
ocommands.lua:48>

The function get_expand_root is defined locally inside a previous code block and is therefore unavailable.

https://github.com/joshuadanpeterson/typewriter.nvim/blob/9e15168ab6edd852a6fdfcd6458e6d772723d737/lua/typewriter/commands.lua#L93

joshuadanpeterson commented 1 month ago

@Rasmus-Bertell Thanks for calling attention to that. I'll fix that this weekend and let you know.

joshuadanpeterson commented 1 month ago

@Rasmus-Bertell Fixed the issue