diff --git a/cptr/frontend/src/lib/apis/git.ts b/cptr/frontend/src/lib/apis/git.ts index 888ea7a..61d8329 100644 --- a/cptr/frontend/src/lib/apis/git.ts +++ b/cptr/frontend/src/lib/apis/git.ts @@ -39,8 +39,10 @@ export const getGitLog = (root: string, limit = 30) => export const getGitDiff = (params: string) => fetchJSON(`/api/git/diff?${params}`); -export const getGitShow = (root: string, ref: string) => - fetchJSON(`/api/git/show?root=${encodeURIComponent(root)}&ref=${encodeURIComponent(ref)}`); +export const getGitShow = (root: string, ref: string, ignoreWhitespace = false) => + fetchJSON( + `/api/git/show?root=${encodeURIComponent(root)}&ref=${encodeURIComponent(ref)}&ignore_whitespace=${ignoreWhitespace}` + ); export const getGitBranches = (root: string) => fetchJSON(`/api/git/branches?root=${encodeURIComponent(root)}`); diff --git a/cptr/frontend/src/lib/components/DiffHunkRows.svelte b/cptr/frontend/src/lib/components/DiffHunkRows.svelte new file mode 100644 index 0000000..57fa104 --- /dev/null +++ b/cptr/frontend/src/lib/components/DiffHunkRows.svelte @@ -0,0 +1,186 @@ + + +{#if $diffDisplayMode === 'split'} + {#each splitDiffRows(lines) as row} +
{hunk.header}
- {#each groupDiffLines(withInlineDiffSegments(diffNumberedLines(hunk))) as group}
-