From 37809592480a0dbb4b2694ab545d4e9568157040 Mon Sep 17 00:00:00 2001 From: Tan Long Date: Tue, 21 Nov 2023 21:58:06 +0800 Subject: [PATCH] register git.nextChunk and git.prevChunk commands --- Readme.md | 4 +++- src/index.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index d0d9d08..01cf8d9 100644 --- a/Readme.md +++ b/Readme.md @@ -214,7 +214,9 @@ xmap ag (coc-git-chunk-outer) Use command `:CocCommand` to open commands and type `git.` to get all git related commands. -- `:CocCommand git.copyUrl` Copy url of current line to clipboard +- `:CocCommand git.copyUrl` Copy url of current line to clipboard. +- `:CocCommand git.nextChunk` Navigate to the next chunk. +- `:CocCommand git.prevChunk` Navigate to the previous chunk. - `:CocCommand git.chunkInfo` Show chunk info under cursor. - `:CocCommand git.chunkUndo` Undo current chunk. - `:CocCommand git.chunkStage` Stage current chunk. diff --git a/src/index.ts b/src/index.ts index 8593bb0..090b788 100644 --- a/src/index.ts +++ b/src/index.ts @@ -83,6 +83,14 @@ export async function activate(context: ExtensionContext): Promise { + await manager.nextChunk(); + })); + + subscriptions.push(commands.registerCommand("git.prevChunk", async () => { + await manager.prevChunk(); + })); + subscriptions.push(commands.registerCommand('git.keepCurrent', async () => { await manager.keepCurrent() }))