Register the git.nextChunk and git.prevChunk commands
tanloong opened this issue · comments
Tan, Long commented
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 CocCommand
s.
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
Heyward Fann commented
Your code is correct, PR is welcome!
Tan, Long commented
Great! Making the PR. Sorry for the delayed response.