File tree 1 file changed +8
-1
lines changed
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/registry
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*******************************************************************************
2
- * Copyright (c) 2000, 2017 IBM Corporation and others.
2
+ * Copyright (c) 2000, 2025 IBM Corporation and others.
3
3
*
4
4
* This program and the accompanying materials
5
5
* are made available under the terms of the Eclipse Public License 2.0
@@ -1358,6 +1358,13 @@ private IEditorDescriptor selectDefaultEditor(List<IEditorDescriptor> descriptor
1358
1358
String key = IPreferenceConstants .DEFAULT_EDITOR_FOR_CONTENT_TYPE + contentType .getId ();
1359
1359
String defaultEditorId = store .getString (key );
1360
1360
IEditorDescriptor descriptor = null ;
1361
+ if (defaultEditorId .isEmpty () && contentType .getId ().contentEquals ("org.eclipse.core.runtime.text" )) { //$NON-NLS-1$
1362
+ IEditorDescriptor genericEditor = descriptors .stream ()
1363
+ .filter (e -> "org.eclipse.ui.genericeditor.GenericEditor" .equals (e .getId ())) //$NON-NLS-1$
1364
+ .findFirst ().orElse (null );
1365
+ store .setValue (key , genericEditor .getId ());
1366
+ return genericEditor ;
1367
+ }
1361
1368
if (defaultEditorId != null && !defaultEditorId .isBlank ()) {
1362
1369
descriptor = descriptors .stream ().filter (d -> defaultEditorId .equals (d .getId ())).findFirst ().orElse (null );
1363
1370
}
You can’t perform that action at this time.
0 commit comments