feat(parser/diff): default max diff length 2048
This commit is contained in:
		
							parent
							
								
									e5ae6fc223
								
							
						
					
					
						commit
						0b841dd730
					
				|  | @ -30,7 +30,7 @@ type Conf struct { | ||||||
| 			CompareSpace    bool | 			CompareSpace    bool | ||||||
| 			AlwaysHide      bool | 			AlwaysHide      bool | ||||||
| 			ForceQuitOnDiff bool | 			ForceQuitOnDiff bool | ||||||
| 			MaxDiffLength   int | 			MaxDiffLength   int `default:"2048"` // just for reference
 | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | @ -83,7 +83,9 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) ( | ||||||
| 
 | 
 | ||||||
| 					// Generate Myers diff
 | 					// Generate Myers diff
 | ||||||
| 					diffOps := myersDiff(stdoutLines, resultLines) | 					diffOps := myersDiff(stdoutLines, resultLines) | ||||||
| 
 | 					if output.MaxDiffLength == 0 { // real default value
 | ||||||
|  | 						output.MaxDiffLength = 2048 | ||||||
|  | 					} | ||||||
| 					// Generate diff block with surrounding context
 | 					// Generate diff block with surrounding context
 | ||||||
| 					diffOutput := generateDiffWithContext( | 					diffOutput := generateDiffWithContext( | ||||||
| 						stdoutLines, resultLines, diffOps, output.MaxDiffLength) | 						stdoutLines, resultLines, diffOps, output.MaxDiffLength) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user