@@ -224,12 +224,15 @@ methodOfRpcCall = \case
224
224
renderDiff :: BS. ByteString -> BS. ByteString -> Maybe String
225
225
renderDiff first second
226
226
| first == second = Nothing
227
- renderDiff first second = unsafePerformIO . withTempDir $ \ dir -> do
227
+ | otherwise = renderDiff' [" -w" ] first second
228
+
229
+ renderDiff' :: [String ] -> BS. ByteString -> BS. ByteString -> Maybe String
230
+ renderDiff' diffOptions first second = unsafePerformIO . withTempDir $ \ dir -> do
228
231
let path1 = dir </> " diff_file1.txt"
229
232
path2 = dir </> " diff_file2.txt"
230
233
BS. writeFile path1 first
231
234
BS. writeFile path2 second
232
- (result, str, _) <- readProcessWithExitCode " diff" [ " -w " , path1, path2] " "
235
+ (result, str, _) <- readProcessWithExitCode " diff" (diffOptions <> [ path1, path2]) " "
233
236
case result of
234
237
ExitSuccess -> pure Nothing
235
238
ExitFailure 1 -> pure $ Just str
@@ -240,7 +243,7 @@ renderDiff first second = unsafePerformIO . withTempDir $ \dir -> do
240
243
-- This uses the `pretty` instance for a textual diff.
241
244
diffBy :: Internal. KoreDefinition -> KorePattern -> KorePattern -> Maybe String
242
245
diffBy def pat1 pat2 =
243
- renderDiff (internalise pat1) (internalise pat2)
246
+ renderDiff' [ " -c " , " -w " ] (internalise pat1) (internalise pat2)
244
247
where
245
248
renderBS :: TermOrPredicates -> BS. ByteString
246
249
renderBS (Predicates ps) =
0 commit comments