Skip to content

Commit b49a52e

Browse files
committed
fix(ui): ensure text wrap works in HunkDiff
1 parent b12c8b2 commit b49a52e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@
210210
{@render countColumn(CountColumnSide.After)}
211211
<td
212212
class="table__textContent"
213-
style="--tab-size: {tabSize}; --wrap: {wrapText ? 'wrap' : 'nowrap'}"
213+
style="--tab-size: {tabSize}; --wrap: {wrapText ? 'wrap' : 'nowrap'}; --pre-wrap: {wrapText
214+
? 'pre-wrap'
215+
: 'pre'}"
214216
class:readonly={true}
215217
data-no-drag
216218
class:diff-line-deletion={row.type === SectionType.RemovedLines}
@@ -293,7 +295,7 @@
293295
font-size: 12px;
294296
line-height: 1.25;
295297
text-wrap: var(--wrap);
296-
white-space: pre;
298+
white-space: var(--pre-wrap);
297299
cursor: text;
298300
tab-size: var(--tab-size);
299301
user-select: text;
@@ -303,7 +305,7 @@
303305
position: relative;
304306
min-height: 18px;
305307
text-wrap: var(--wrap);
306-
white-space: pre;
308+
white-space: var(--pre-wrap);
307309
cursor: text;
308310
user-select: text;
309311
-webkit-user-select: text;

0 commit comments

Comments
 (0)