yujinyuz / gitpad.nvim

minimal neovim plugin for taking down notes for git projects, branch, etc.
https://yujinyuz.github.io/gitpad.nvim/
MIT License
43 stars 4 forks source link

Vim:E32: No file name #3

Closed mattydebie closed 1 month ago

mattydebie commented 1 month ago

This plugin looks really helpful !

I'm getting an issue though when trying to toggle any gitpad (project, branch, ..)

Error:

[gitpad.nvim] Unable to create file: /home/mattydebie/.local/share/nvim/gitpad/xxx/gitpad.md
E5108: Error executing lua: ...e/.local/share/nvim/lazy/gitpad.nvim/lua/gitpad/init.lua:154: Vim:E32: No file name
stack traceback:
        [C]: in function 'edit'
        ...e/.local/share/nvim/lazy/gitpad.nvim/lua/gitpad/init.lua:154: in function 'open_window'
        ...e/.local/share/nvim/lazy/gitpad.nvim/lua/gitpad/init.lua:187: in function 'toggle_window'
        ...e/.local/share/nvim/lazy/gitpad.nvim/lua/gitpad/init.lua:194: in function 'toggle_gitpad'
        ...e/mattydebie/.config/nvim/lua/madebit/plugins/gitpad.lua:10: in function <...e/mattydebie/.config/nvim/lua/madebit/plugins/gitpad.lua:9>

Config in lazy:

return {
    'yujinyuz/gitpad.nvim',
    config = function()
        require('gitpad').setup()
    end,
    keys = {
        {
            '<leader>pp',
            function()
                require('gitpad').toggle_gitpad()
            end,
            desc = 'gitpad project',
        },
        {
            '<leader>pb',
            function()
                require('gitpad').toggle_gitpad_branch()
            end,
            desc = 'gitpad branch',
        },
        -- Daily notes
        {
            '<leader>pd',
            function()
                local date_filename = 'daily-' .. os.date('%Y-%m-%d.md')
                require('gitpad').toggle_gitpad({ filename = date_filename })
            end,
            desc = 'gitpad daily notes',
        },
    },
}

Terminal emulator: kitty Terminal: zsh Neovim version: 0.9.5

mattydebie commented 1 month ago

Seems to be fixed when manually creating the ~/.local/share/nvim/gitpad folder

yujinyuz commented 1 month ago

@mattydebie Thanks for trying this plugin and reporting this issue.

I was able to reproduce this by providing a new dir in the setup and I was able to reproduce it.

  require('gitpad').setup {
    dir = vim.fn.stdpath('data') .. '/new-gitpad'
  }

Should be fixed now