pull the filename from the +++ line

This commit is contained in:
Paul Gauthier 2023-12-17 15:19:34 -08:00
parent 6165fcc960
commit 042a2b8a08
3 changed files with 3 additions and 4 deletions

View file

@ -584,7 +584,6 @@ def flexible_search_and_replace(texts, strategies):
for preproc in preprocs:
res = try_strategy(texts, strategy, preproc)
if res:
dump(strategy, preproc)
return res

View file

@ -334,8 +334,8 @@ def process_fenced_block(lines, start_line_num):
block = lines[start_line_num:line_num]
block.append("@@ @@")
if block[0].startswith("--- "):
fname = block[0].split()[1]
if block[1].startswith("+++ "):
fname = block[1].split()[1]
block = block[2:]
else:
fname = None