Skip to content

Commit fa78f71

Browse files
author
Federico Fissore
committed
Editor on MacOSX: editor.keys.home_and_end_beginning_end_of_doc, when set to true, makes HOME and END keys go to the beginning and end of the line. Fixes #3715
1 parent 36e4371 commit fa78f71

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/src/processing/app/syntax/SketchTextAreaDefaultInputMap.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ public SketchTextAreaDefaultInputMap() {
4949

5050
put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, defaultModifier | shift), DefaultEditorKit.selectionBeginAction);
5151
put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, defaultModifier | shift), DefaultEditorKit.selectionEndAction);
52+
53+
if (PreferencesData.getBoolean("editor.keys.home_and_end_to_start_end_of_doc")) {
54+
put(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0), DefaultEditorKit.beginLineAction);
55+
put(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0), DefaultEditorKit.endLineAction);
56+
}
5257
}
5358

5459
put(KeyStroke.getKeyStroke(KeyEvent.VK_DIVIDE, defaultModifier), RSyntaxTextAreaEditorKit.rstaToggleCommentAction);

build/shared/lib/preferences.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,8 @@ editor.keys.alternative_cut_copy_paste.macosx = false
118118
# false if shift-backspace just means backspace
119119
editor.keys.shift_backspace_is_delete = true
120120

121-
# home and end keys should only travel to the start/end of the current line
122-
editor.keys.home_and_end_travel_far = false
123-
# the OS X HI Guidelines say that home/end are relative to the document
124-
# if you don't like it, this is the preference to change
125-
editor.keys.home_and_end_travel_far.macosx = true
121+
# if set to true, home/end keys will go to the start/end of current line
122+
editor.keys.home_and_end_beginning_end_of_doc = false
126123

127124
console = true
128125
console.output.file = stdout.txt

0 commit comments

Comments
 (0)