fix(external-editor): Fix TextEditorConfig parsing and add error handling

- TextEditorConfig.from_dict no longer requires 'name' field since name comes from dict key
- Added try/except around _render_external_editor_panel to prevent tab bar mismatch
This commit is contained in:
2026-05-07 19:30:45 -04:00
parent 0948cae5a0
commit 8fe366e041
2 changed files with 9 additions and 2 deletions
+5 -1
View File
@@ -425,7 +425,11 @@ class ExternalEditorConfig:
editors = {}
for name, ed_data in data.get("editors", {}).items():
if isinstance(ed_data, dict):
editors[name] = TextEditorConfig.from_dict(ed_data)
editors[name] = TextEditorConfig(
name=name,
path=ed_data.get("path", ""),
diff_args=ed_data.get("diff_args", []),
)
elif isinstance(ed_data, str):
editors[name] = TextEditorConfig(name=name, path=ed_data)
return cls(