Fix macOS external editor app chooser popping up

This commit is contained in:
Lawrence Lee
2023-08-04 22:32:39 -07:00
parent a626bdae3e
commit 7ad414aa63
2 changed files with 11 additions and 5 deletions

View File

@@ -1755,7 +1755,12 @@ void Preferences::storePreferences()
const std::vector<ExternalEditorPreferences::EditorInfo> &editors = externalEditors->getEditors();
moptions.externalEditors.resize(editors.size());
moptions.externalEditorIndex = -1;
moptions.externalEditorIndex =
#ifdef __APPLE__
editors.empty() ? -1 : 0;
#else
-1;
#endif
for (unsigned i = 0; i < editors.size(); i++) {
moptions.externalEditors[i] = (ExternalEditor(
editors[i].name, editors[i].command, editors[i].native_command, editors[i].icon_serialized));