1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

Patch from Anton Leherbauer for bug 39399, 'goto home' in CEditor.

This commit is contained in:
Markus Schorn 2006-04-25 13:50:43 +00:00
parent e6af39c712
commit d85160f0be

View file

@ -48,6 +48,7 @@ import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.texteditor.AbstractTextEditor;
/*
* The page for setting the editor options.
@ -126,6 +127,16 @@ public class CEditorPreferencePage extends AbstractPreferencePage implements IWo
public static void initDefaults(IPreferenceStore store) {
// bug 84414: enable smart home/end handling
// This is a hidden feature of the Eclipse TextEditor:
// If enabled, the HOME button positions the cursor to the first
// non-whitespace character of the line (ie. the logical start of
// the line). Pressing it a second time, positions the cursor to the
// first character of the line, ie. to the physical start of the line.
// The END button works correspondingly for the end of the line.
// JDT also enables this feature.
store.setDefault(AbstractTextEditor.PREFERENCE_NAVIGATION_SMART_HOME_END, true);
store.setDefault(CEditor.MATCHING_BRACKETS, true);
PreferenceConverter.setDefault(store, CEditor.MATCHING_BRACKETS_COLOR, new RGB(170,170,170));