monaqa / dial.nvim

enhanced increment/decrement plugin for Neovim.
MIT License
794 stars 12 forks source link

Plugin stopped working after first use? #72

Closed GideonWolfe closed 1 year ago

GideonWolfe commented 1 year ago

I installed this plugin and tested it by configuring a single keymap and testing it with a date.

I wrote out (2022/11/01) and observed that incrementing the 11 to 13 would instead roll the year around to (2023/01/01).

Eager at the success, I added the rest of the keymaps and tried them out, only to find out that the plugin had stopped working entirely.

Now when I manually run DialIncrement when my cursor is over the 11 in (2022/11/01), it simply increments the year to (2023/11/01) instead of the month to (2022/12/01).

My keybinds are defined as follows:

utility remap function (imported into map config file)


function M.nmap(lhs, rhs, opts)
    local options = {noremap = false}
    if opts then options = vim.tbl_extend('force', options, opts) end
    api.nvim_set_keymap('n', lhs, rhs, options)
end

vmap is also imported from this utility file

map configs here

nmap("<C-a>", "<Plug>(dial-increment)")
nmap("<C-x>", "<Plug>(dial-decrement)")
nmap("g<C-a>", "g<Plug>(dial-increment)")
nmap("g<C-x>", "g<Plug>(dial-decrement)")
vmap("<C-a>", "<Plug>(dial-increment)")
vmap("<C-x>", "<Plug>(dial-decrement)")
vmap("g<C-a>", "g<Plug>(dial-increment)")
vmap("g<C-x>", "g<Plug>(dial-decrement)")

Pressing Ctrl+a on a boolean, date, or other non-regular incrementable item simply does nothing. It seriously worked the first time I booted up neovim with the plugin installed!!

monaqa commented 1 year ago

I can't figure out the cause with those information. Can you reproduce it with a minimally configured vimrc? One that does not use the package manager is preferred.

monaqa commented 1 year ago

If it is difficult to create a reproducible minimum configuration, please share the code for the entire configuration file or a link to it (if you are publishing on GitHub or others). Since I could not reproduce it with just the code already shared, I guess it is due to something else.

GideonWolfe commented 1 year ago

Sorry for the delay, here's my configs

GideonWolfe commented 1 year ago

Hmm, seemed to have fixed itself..