From 4caac7a31c99cf496115646d7daa5965b8a07e55 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 20 Jan 2026 20:46:51 -0600 Subject: [PATCH] Refactor line change calculations in PatchTree.build function for improved readability and maintainability. --- plugin/src/PatchTree.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/src/PatchTree.lua b/plugin/src/PatchTree.lua index fe6cd522..66116ebc 100644 --- a/plugin/src/PatchTree.lua +++ b/plugin/src/PatchTree.lua @@ -263,7 +263,8 @@ function PatchTree.build(patch, instanceMap, changeListHeaders) -- Check if this is a Source property - count line differences if prop == "Source" and currentSuccess and incomingSuccess then hasSourceChange = true - totalLineChanges, whitespaceLineChanges = WhitespaceUtil.CountLineDifferences(currentValue, incomingValue) + totalLineChanges, whitespaceLineChanges = + WhitespaceUtil.CountLineDifferences(currentValue, incomingValue) end addProp( @@ -279,7 +280,9 @@ function PatchTree.build(patch, instanceMap, changeListHeaders) changeInfo = { -- Line changes for Source (nil if no Source change) lineChanges = if hasSourceChange and totalLineChanges > 0 then totalLineChanges else nil, - isWhitespaceOnly = hasSourceChange and totalLineChanges > 0 and totalLineChanges == whitespaceLineChanges, + isWhitespaceOnly = hasSourceChange + and totalLineChanges > 0 + and totalLineChanges == whitespaceLineChanges, -- Property changes (non-Source: Name, Attributes, etc.) propChanges = if propCount > 0 then propCount else nil, }