This commit is contained in:
Paul Gauthier 2023-06-05 22:34:44 -07:00
parent 05c08b36a7
commit 8f70f1b251
2 changed files with 7 additions and 7 deletions

View file

@ -478,7 +478,7 @@ class Coder:
show_resp = self.resp show_resp = self.resp
if self.main_model == Models.GPT35: if self.main_model == Models.GPT35:
try: try:
show_resp = self.update_files_gpt35(self.resp, just_diffs=True) show_resp = self.update_files_gpt35(self.resp, mode="diff")
except ValueError: except ValueError:
pass pass
md = Markdown(show_resp, style="blue", code_theme="default") md = Markdown(show_resp, style="blue", code_theme="default")
@ -490,11 +490,11 @@ class Coder:
if live: if live:
live.stop() live.stop()
def update_files_gpt35(self, content, just_diffs=False): def update_files_gpt35(self, content, mode="update"):
edited = set() edited = set()
chat_files = self.get_inchat_relative_files() chat_files = self.get_inchat_relative_files()
if not chat_files: if not chat_files:
if just_diffs: if mode == "diff":
return content return content
return return
@ -508,7 +508,7 @@ class Coder:
# ending an existing block # ending an existing block
full_path = os.path.abspath(os.path.join(self.root, fname)) full_path = os.path.abspath(os.path.join(self.root, fname))
if just_diffs: if mode == "diff":
with open(full_path, "r") as f: with open(full_path, "r") as f:
orig_lines = f.readlines() orig_lines = f.readlines()
@ -544,12 +544,12 @@ class Coder:
else: else:
output.append(line) output.append(line)
if just_diffs: if mode == "diff":
if fname: if fname:
# ending an existing block # ending an existing block
full_path = os.path.abspath(os.path.join(self.root, fname)) full_path = os.path.abspath(os.path.join(self.root, fname))
if just_diffs: if mode == "diff":
with open(full_path, "r") as f: with open(full_path, "r") as f:
orig_lines = f.readlines() orig_lines = f.readlines()

View file

@ -26,7 +26,7 @@ def main():
def create_progress_bar(percentage): def create_progress_bar(percentage):
block = "" block = ""
empty = "" empty = ""
total_blocks = 40 total_blocks = 30
filled_blocks = int(total_blocks * percentage // 100) filled_blocks = int(total_blocks * percentage // 100)
empty_blocks = total_blocks - filled_blocks empty_blocks = total_blocks - filled_blocks
bar = block * filled_blocks + empty * empty_blocks bar = block * filled_blocks + empty * empty_blocks