jakewvincent / mkdnflow.nvim

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

Bug: Issue when renaming file with :MkdnMoveSource #249

Closed Hugogerva closed 1 month ago

Hugogerva commented 1 month ago

Bug description I'm using perspective = root.

When I try to rename a file, I get this error :

Error executing Lua callback: ...cal/share/nvim
/lazy/mkdnflow.nvim/lua/mkdnflow/paths.lua:519: attempt to call field 'escapeChars' (a nil value)                                                          
stack traceback:                                                                                                                                           
        ...cal/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/paths.lua:519: in function 'on_confirm'                                                          
        /usr/share/nvim/runtime/lua/vim/ui.lua:105: in function 'input'                                                                                    
        ...cal/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/paths.lua:509: in function 'confirm_and_execute'                                                 
        ...cal/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/paths.lua:613: in function 'on_confirm'                                                          
        /usr/share/nvim/runtime/lua/vim/ui.lua:105: in function 'input'                                                                                    
        ...cal/share/nvim/lazy/mkdnflow.nvim/lua/mkdnflow/paths.lua:575: in function 'moveSource'                                                          
        ....local/share/nvim/lazy/mkdnflow.nvim/plugin/mkdnflow.lua:51: in function <....local/share/nvim/lazy/mkdnflow.nvim/plugin/mkdnflow.lua:50>

Going to paths.lua and changing :

                            .. utils.escapeChars(derived_source)
                            .. ' '
                            .. utils.escapeChars(derived_goal)

into

                             .. derived_source
                             .. ' '
                             .. derived_goal

Seemed to allow me to rename the file. But I'm guessing if I have characters to escape this will fail again. Also, when I checked utils.lua I didn't find any mention of escapeChars?

Context (Please complete the following information):

jakewvincent commented 1 month ago

Hi @Hugogerva, thanks for the call-out! I had replaced my internal escaping function with a native vim function everywhere else but somehow forgot to replace it in this function. It should be fixed now. Please let me know if you're still experiencing issues after updating.