From 28584b5705a73a9b1d17e3e682e438f854b6de1a Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 10 May 2023 09:32:45 -0700 Subject: [PATCH] wip: Changed file path handling and edited file tracking in Coder class. --- aider/coder.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aider/coder.py b/aider/coder.py index ffca86841..d79d04b41 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -349,8 +349,10 @@ class Coder: path = path.strip() - if path not in self.fnames: - if not Path(path).exists(): + full_path = os.path.join(self.root, path) + + if full_path not in self.fnames: + if not Path(full_path).exists(): question = f"[red]Allow creation of new file {path}?" else: question = ( @@ -362,8 +364,7 @@ class Coder: self.fnames.add(path) - full_path = os.path.join(self.root, path) - edited.add(full_path) + edited.add(path) if utils.do_replace(full_path, original, updated): self.console.print(f"[red]Applied edit to {path}") else: