Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register the git.nextChunk and git.prevChunk commands #210

Open
tanloong opened this issue Nov 21, 2023 · 2 comments
Open

Register the git.nextChunk and git.prevChunk commands #210

tanloong opened this issue Nov 21, 2023 · 2 comments

Comments

@tanloong
Copy link

tanloong commented Nov 21, 2023

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

@fannheyward
Copy link
Member

Your code is correct, PR is welcome!

@tanloong
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants