Skip to content

Commit b87d15f

Browse files
committed
Fix handling of split for \G{
It should not mess with the first element.
1 parent 57fbe0e commit b87d15f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gitsearchreplace/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def calc_big_g(self, big_g_expr):
5454
"""Transform the special interpolated \G{<python>}"""
5555
parts = []
5656
prefix = r'\G{'
57-
for part in big_g_expr.split(prefix):
57+
oparts = big_g_expr.split(prefix)
58+
parts = [oparts[0]]
59+
for part in oparts[1:]:
5860
if '}' in part:
5961
x = part.find('}')
6062
parts.append(prefix + part[:x+1])

0 commit comments

Comments
 (0)