From 0d8970061edee1f3d0fc2661538b3121041bb5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Wed, 21 Oct 2026 20:28:07 +0200 Subject: [PATCH] extend filename detection to not take spaces into account --- copienator/workspace.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/copienator/workspace.py b/copienator/workspace.py index 331d49f..1bb3b4d 100644 --- a/copienator/workspace.py +++ b/copienator/workspace.py @@ -87,7 +87,15 @@ class EvaluationWorkspace: "correction.tex": ("correction.tex", "corrige.tex", "corrigé.tex", f"{self.name}c.tex"), } names = aliases.get(canonical_name, (canonical_name,)) - return tuple(self.root / name for name in names) + candidates = tuple(self.root / name for name in names) + if canonical_name in aliases and self.root.is_dir(): + folder_alias = names[-1].replace(" ", "") + candidates += tuple( + path + for path in sorted(self.root.iterdir()) + if path.name.replace(" ", "") == folder_alias and path not in candidates + ) + return candidates def resolve(self, relative_path: str) -> Path: """Resolve a logical workspace path, including statement aliases."""