neoclide / coc-git

Git integration of coc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Register the git.nextChunk and git.prevChunk commands

tanloong opened this issue · comments

Hi. I am trying to let chunkinfo automatically shown after navigating to next/previous chunk but fail with any of the following mappings.

nnoremap gn <Plug>(coc-git-nextchunk)<Plug>(coc-git-chunkinfo)
nnoremap gn <Plug>(coc-git-nextchunk);<Plug>(coc-git-chunkinfo)
nnoremap gn <Plug>(coc-git-nextchunk);:CocCommand git.chunkinfo<CR>

After registering the nextChunk and prevChunk commands, I get what I want by mapping keys to two consecutive CocCommands.

nnoremap gp :CocCommand git.prevChunk<CR>:sleep 100m<CR>:CocCommand git.chunkInfo<CR>
nnoremap gn :CocCommand git.nextChunk<CR>:sleep 100m<CR>:CocCommand git.chunkInfo<CR>

I have no prior knowledge about JS and the change is a simple imitation of how other commands are registered. Does the change miss anything? May I create a PR?

master...tanloong:coc-git:register-git.nextChunk-and-git.prevChunk-commands

Your code is correct, PR is welcome!

Great! Making the PR. Sorry for the delayed response.