Replace valid_formats with dynamically generated list of coder.__all__ entries with edit_format attribute

This commit is contained in:
Your Name (aider) 2024-07-28 19:23:23 -03:00
parent c9003c598f
commit 7f028eeb1e

View file

@ -48,7 +48,7 @@ class Commands:
"Switch to a new editing mode"
ef = args.strip()
valid_formats = "diff udiff whole".split()
valid_formats = [coder.__name__ for coder in self.coder.__all__ if hasattr(coder, 'edit_format')]
if ef not in valid_formats:
self.io.tool_error(