Skip to content

Commit 296fda5

Browse files
committed
fix newline formatting
1 parent 7bebb16 commit 296fda5

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

codebot/codebot.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ def parse_response(self, input_str: str):
8080
if not in_code_block:
8181
ignore_code_block = False
8282
else:
83-
if line.strip():
84-
is_code = in_code_block and not ignore_code_block
85-
result.append({"code": is_code, "content": line})
83+
is_code = in_code_block and not ignore_code_block
84+
result.append({"code": is_code, "content": line})
8685
return result
8786

8887
def execute_code(self, code: str):
@@ -124,9 +123,9 @@ def run(self):
124123

125124
for r in gpt_response_parsed:
126125
if r["code"]:
127-
print(f"{COLOR_GREEN}{r['content']}{COLOR_RESET}\n")
126+
print(f"{COLOR_GREEN}{r['content']}{COLOR_RESET}")
128127
else:
129-
print(f"{COLOR_GRAY}{r['content']}{COLOR_RESET}\n")
128+
print(f"{COLOR_GRAY}{r['content']}{COLOR_RESET}")
130129

131130
if gpt_code.strip():
132131
result = self.execute_code(gpt_code)

0 commit comments

Comments
 (0)