refactor(parser/diff): MaxDiffSize => MaxDiffLength

This commit is contained in:
张泊明518370910136 2024-11-04 08:31:40 -05:00
parent cc435f9156
commit 0df4df339f
GPG Key ID: D47306D7062CDA9D

View File

@ -30,7 +30,7 @@ type Conf struct {
CompareSpace bool CompareSpace bool
AlwaysHide bool AlwaysHide bool
ForceQuitOnDiff bool ForceQuitOnDiff bool
MaxDiffSize int MaxDiffLength int
} }
} }
} }
@ -86,7 +86,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
// Generate diff block with surrounding context // Generate diff block with surrounding context
diffOutput := generateDiffWithContext( diffOutput := generateDiffWithContext(
stdoutLines, resultLines, diffOps, output.MaxDiffSize) stdoutLines, resultLines, diffOps, output.MaxDiffLength)
diffOutput = strings.TrimSuffix(diffOutput, "\n \n") diffOutput = strings.TrimSuffix(diffOutput, "\n \n")
comment += fmt.Sprintf( comment += fmt.Sprintf(
"```diff\n%s\n```\n", "```diff\n%s\n```\n",