Skip to content

Commit ebd9fe4

Browse files
ignore long line to syntax
1 parent 1edb22b commit ebd9fe4

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/react/src/components/DiffContent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ export const DiffContent = ({
147147

148148
const isDelete = diffLine?.type === DiffLineType.Delete;
149149

150+
const isMaxLineLengthToIgnoreSyntax = syntaxLine?.nodeList?.length > 150;
151+
150152
return (
151153
<div
152154
className="diff-line-content-item pl-[2.0em]"
@@ -162,7 +164,7 @@ export const DiffContent = ({
162164
>
163165
{isAdded ? "+" : isDelete ? "-" : " "}
164166
</span>
165-
{enableHighlight && syntaxLine ? (
167+
{enableHighlight && syntaxLine && !isMaxLineLengthToIgnoreSyntax ? (
166168
<DiffSyntax
167169
operator={isAdded ? "add" : isDelete ? "del" : undefined}
168170
rawLine={rawLine}

packages/vue/src/components/DiffContent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ export const DiffContent = ({
146146

147147
const isDelete = diffLine?.type === DiffLineType.Delete;
148148

149+
const isMaxLineLengthToIgnoreSyntax = syntaxLine?.nodeList?.length > 150;
150+
149151
return (
150152
<div
151153
class="diff-line-content-item pl-[2.0em]"
@@ -161,7 +163,7 @@ export const DiffContent = ({
161163
>
162164
{isAdded ? "+" : isDelete ? "-" : " "}
163165
</span>
164-
{enableHighlight && syntaxLine ? (
166+
{enableHighlight && syntaxLine && !isMaxLineLengthToIgnoreSyntax ? (
165167
<DiffSyntax
166168
operator={isAdded ? "add" : isDelete ? "del" : undefined}
167169
rawLine={rawLine}

0 commit comments

Comments
 (0)