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: