From d85160f0bee942e3d609735637518742df5d9f22 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Tue, 25 Apr 2006 13:50:43 +0000 Subject: [PATCH] Patch from Anton Leherbauer for bug 39399, 'goto home' in CEditor. --- .../ui/preferences/CEditorPreferencePage.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java index 150ed716815..9548c9268d0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java @@ -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));