mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	Use ScanLinesAndTruncateWhenLongerThanBuffer instead of bufio.ScanLines
This commit is contained in:
		| @@ -161,7 +161,7 @@ func (self *cmdObjRunner) RunAndProcessLines(cmdObj ICmdObj, onLine func(line st | ||||
| 	} | ||||
|  | ||||
| 	scanner := bufio.NewScanner(stdoutPipe) | ||||
| 	scanner.Split(bufio.ScanLines) | ||||
| 	scanner.Split(utils.ScanLinesAndTruncateWhenLongerThanBuffer(bufio.MaxScanTokenSize)) | ||||
| 	if err := cmd.Start(); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|   | ||||
| @@ -99,7 +99,7 @@ func FileHasConflictMarkers(path string) (bool, error) { | ||||
| // Efficiently scans through a file looking for merge conflict markers. Returns true if it does | ||||
| func fileHasConflictMarkersAux(file io.Reader) bool { | ||||
| 	scanner := bufio.NewScanner(file) | ||||
| 	scanner.Split(bufio.ScanLines) | ||||
| 	scanner.Split(utils.ScanLinesAndTruncateWhenLongerThanBuffer(bufio.MaxScanTokenSize)) | ||||
| 	for scanner.Scan() { | ||||
| 		line := scanner.Bytes() | ||||
|  | ||||
|   | ||||
| @@ -162,7 +162,7 @@ func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), p | ||||
| 		done := make(chan struct{}) | ||||
|  | ||||
| 		scanner := bufio.NewScanner(r) | ||||
| 		scanner.Split(bufio.ScanLines) | ||||
| 		scanner.Split(utils.ScanLinesAndTruncateWhenLongerThanBuffer(bufio.MaxScanTokenSize)) | ||||
|  | ||||
| 		lineChan := make(chan []byte) | ||||
| 		lineWrittenChan := make(chan struct{}) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user