File tree Expand file tree Collapse file tree 5 files changed +21
-1
lines changed Expand file tree Collapse file tree 5 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ async function doShow(
6161 `++opener=${ opener } ` ,
6262 ...( emojify ? [ `++emojify` ] : [ ] ) ,
6363 `++diffjump=${ x . commit } ` ,
64+ `++difffold` ,
6465 "show" ,
6566 x . commit ,
6667 ] ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export type ExecOptions = {
1212 opener ?: string ;
1313 emojify ?: boolean ;
1414 diffjump ?: string ;
15+ difffold ?: boolean ;
1516 filetype ?: string ;
1617 cmdarg ?: string ;
1718 mods ?: string ;
@@ -36,6 +37,7 @@ export async function exec(
3637 monochrome : unnullish ( options . monochrome , ( v ) => v ? "" : undefined ) ,
3738 emojify : unnullish ( options . emojify , ( v ) => v ? "" : undefined ) ,
3839 diffjump : options . diffjump ,
40+ difffold : unnullish ( options . difffold , ( v ) => v ? "" : undefined ) ,
3941 filetype : options . filetype ?? "gin-buffer" ,
4042 } ,
4143 fragment : `${ args . join ( " " ) } $` ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717} from "../../util/ansi_escape_code.ts" ;
1818import { execute } from "../../git/executor.ts" ;
1919import { init as initDiffJump } from "../../feat/diffjump/jump.ts" ;
20+ import { init as initDiffFold } from "../../feat/difffold/fold.ts" ;
2021
2122export async function edit (
2223 denops : Denops ,
@@ -50,11 +51,16 @@ export async function edit(
5051 emojify : "emojify" in ( params ?? { } ) ,
5152 } ) ;
5253
53- // Initialize diff jump functionality if ++jump option is present
54+ // Initialize diff jump functionality if ++diffjump option is present
5455 const jumpCommitish = params ?. diffjump ;
5556 if ( jumpCommitish !== undefined ) {
5657 await initDiffJump ( denops , bufnr , "buffer" ) ;
5758 }
59+
60+ // Initialize diff fold functionality if ++difffold option is present
61+ if ( "difffold" in ( params ?? { } ) ) {
62+ await initDiffFold ( denops , bufnr ) ;
63+ }
5864}
5965
6066export type ExecOptions = {
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ async function command(
9898 "opener" ,
9999 "emojify" ,
100100 "diffjump" ,
101+ "difffold" ,
101102 "filetype" ,
102103 ...builtinOpts ,
103104 ] ) ;
@@ -108,6 +109,7 @@ async function command(
108109 opener : opts . opener ,
109110 emojify : unnullish ( opts . emojify , ( ) => true ) ,
110111 diffjump : opts . diffjump ,
112+ difffold : unnullish ( opts . difffold , ( ) => true ) ,
111113 filetype : opts . filetype ,
112114 cmdarg : formatOpts ( opts , builtinOpts ) . join ( " " ) ,
113115 mods,
Original file line number Diff line number Diff line change @@ -151,6 +151,15 @@ COMMANDS *gin-commands*
151151 :GinBuffer ++diffjump show HEAD
152152 :GinBuffer ++diffjump=abc123 show abc123
153153 :GinBuffer ++diffjump log -p -1
154+ <
155+ ++difffold
156+ Enable automatic folding for file sections in unified diff
157+ output. Each file in the diff will be folded separately,
158+ making it easier to navigate large diffs with multiple files.
159+ For example:
160+ >
161+ :GinBuffer ++difffold show HEAD
162+ :GinBuffer ++diffjump ++difffold log -p -1
154163<
155164 ++filetype={filetype}
156165 Specifies the filetype to set for the buffer. Defaults to
You can’t perform that action at this time.
0 commit comments