Skip to content

Commit 341e401

Browse files
committed
fix(ui): ensure text wrap works in HunkDiff
1 parent 1af9337 commit 341e401

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/ui/src/lib/components/hunkDiff/HunkDiffRow.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@
226226

227227
<td
228228
class="table__textContent"
229-
style="--tab-size: {tabSize}; --wrap: {wrapText ? 'wrap' : 'nowrap'}"
229+
style="--tab-size: {tabSize}; --wrap: {wrapText ? 'wrap' : 'nowrap'}; --pre-wrap: {wrapText
230+
? 'pre-wrap'
231+
: 'pre'}"
230232
class:readonly={true}
231233
data-no-drag
232234
class:diff-line-deletion={row.type === SectionType.RemovedLines}
@@ -309,7 +311,7 @@
309311
font-size: 12px;
310312
line-height: 1.25;
311313
text-wrap: var(--wrap);
312-
white-space: pre;
314+
white-space: var(--pre-wrap);
313315
cursor: text;
314316
tab-size: var(--tab-size);
315317
user-select: text;
@@ -319,7 +321,7 @@
319321
position: relative;
320322
min-height: 18px;
321323
text-wrap: var(--wrap);
322-
white-space: pre;
324+
white-space: var(--pre-wrap);
323325
cursor: text;
324326
}
325327

0 commit comments

Comments
 (0)