mirror of
				https://github.com/LDDestroier/CC/
				synced 2025-10-30 23:12:59 +00:00 
			
		
		
		
	Fixed crash when starting selection on empty area
This commit is contained in:
		| @@ -707,6 +707,7 @@ prompt = function(prebuffer, precy, maxY, _eldit) | |||||||
| 		local yAdj = 0 | 		local yAdj = 0 | ||||||
| 		for id,sel in pairs(eldit.selections) do | 		for id,sel in pairs(eldit.selections) do | ||||||
| 			for y = sel[1].y, sel[2].y do | 			for y = sel[1].y, sel[2].y do | ||||||
|  | 				if eldit.buffer[y] then | ||||||
| 					xAdjusts[y] = xAdjusts[y] or {} | 					xAdjusts[y] = xAdjusts[y] or {} | ||||||
| 					if checkWithinArea(#eldit.buffer[y] + 1, y, sel[1].x, sel[1].y, sel[2].x, sel[2].y) then | 					if checkWithinArea(#eldit.buffer[y] + 1, y, sel[1].x, sel[1].y, sel[2].x, sel[2].y) then | ||||||
| 						yAdj = yAdj + 1 | 						yAdj = yAdj + 1 | ||||||
| @@ -720,8 +721,10 @@ prompt = function(prebuffer, precy, maxY, _eldit) | |||||||
| 					end | 					end | ||||||
| 				end | 				end | ||||||
| 			end | 			end | ||||||
|  | 		end | ||||||
| 		for id,sel in pairs(eldit.selections) do | 		for id,sel in pairs(eldit.selections) do | ||||||
| 			for y = sel[2].y, sel[1].y, -1 do | 			for y = sel[2].y, sel[1].y, -1 do | ||||||
|  | 				if eldit.buffer[y] then | ||||||
| 					for x = #eldit.buffer[y] + 1, 1, -1 do | 					for x = #eldit.buffer[y] + 1, 1, -1 do | ||||||
| 						if checkWithinArea(x, y, sel[1].x, sel[1].y, sel[2].x, sel[2].y) then | 						if checkWithinArea(x, y, sel[1].x, sel[1].y, sel[2].x, sel[2].y) then | ||||||
| 							if x == #eldit.buffer[y] + 1 then | 							if x == #eldit.buffer[y] + 1 then | ||||||
| @@ -738,6 +741,7 @@ prompt = function(prebuffer, precy, maxY, _eldit) | |||||||
| 					end | 					end | ||||||
| 				end | 				end | ||||||
| 			end | 			end | ||||||
|  | 		end | ||||||
| 		eldit.selections = {} | 		eldit.selections = {} | ||||||
| 		adjustCursor(0, 0, true) | 		adjustCursor(0, 0, true) | ||||||
| 		return xAdjusts, yAdjusts | 		return xAdjusts, yAdjusts | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 LDDestroier
					LDDestroier