Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions internal/action/defaults_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ var bufdefaults = map[string]string{
"Alt-{": "ParagraphPrevious",
"Alt-}": "ParagraphNext",
"Enter": "InsertNewline",
"CtrlH": "Backspace",
"CtrlH": "ToggleKeyMenu",
"Backspace": "Backspace",
"OldBackspace": "Backspace",
"Alt-CtrlH": "DeleteWordLeft",
"Alt-Backspace": "DeleteWordLeft",
"Tab": "Autocomplete|IndentSelection|InsertTab",
Expand Down Expand Up @@ -65,7 +64,6 @@ var bufdefaults = map[string]string{
"ShiftPageUp": "SelectPageUp",
"ShiftPageDown": "SelectPageDown",
"Ctrl-g": "ToggleHelp",
"Alt-g": "ToggleKeyMenu",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the Alt-g binding, not keep it alongside the newly added Ctrl-h? According to micro's README, the user is still able to make Alt bindings work in macOS by reconfiguring the terminal, so if we just remove this Alt-g binding, it means we introduce a regression for those macOS users who use that?

"Ctrl-r": "ToggleRuler",
"Ctrl-l": "command-edit:goto ",
"Delete": "Delete",
Expand Down
5 changes: 4 additions & 1 deletion internal/action/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ func (k KeyEvent) Name() string {
}

ok := false
if s, ok = tcell.KeyNames[k.code]; !ok {
if k.code == tcell.KeyCtrlH {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why exactly is this needed?

s = "Ctrl-h"
ok = true
} else if s, ok = tcell.KeyNames[k.code]; !ok {
if k.code == tcell.KeyRune {
s = string(k.r)
} else {
Expand Down
2 changes: 1 addition & 1 deletion runtime/help/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ display. From now on, when the documentation shows a command to run (such as

For a list of the default keybindings, run `> help defaultkeys`.
For more information on keybindings, see `> help keybindings`.
To toggle a short list of important keybindings, press Alt-g.
To toggle a short list of important keybindings, press Alt-g (Ctrl-h on macOS).

## Quick-start

Expand Down
2 changes: 1 addition & 1 deletion runtime/help/keybindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ conventions for text editing defaults.
"ShiftPageUp": "SelectPageUp",
"ShiftPageDown": "SelectPageDown",
"Ctrl-g": "ToggleHelp",
"Alt-g": "ToggleKeyMenu",
"Alt-g": "ToggleKeyMenu", (Ctrl-h on Mac)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this, we should probably add a separate line for Ctrl-h on Mac, consistently with existing ones e.g.:

    "AltShiftRight":  "SelectWordRight", (Mac)
    "AltShiftLeft":   "SelectWordLeft", (Mac)
    "CtrlLeft":       "StartOfText", (Mac)
    "CtrlRight":      "EndOfLine", (Mac)

"Ctrl-r": "ToggleRuler",
"Ctrl-l": "command-edit:goto ",
"Delete": "Delete",
Expand Down
4 changes: 2 additions & 2 deletions runtime/help/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ Here are the available options:
default value: `false`

* `keymenu`: display the nano-style key menu at the bottom of the screen. Note
that ToggleKeyMenu is bound to `Alt-g` by default and this is displayed in
the statusline. To disable the key binding, bind `Alt-g` to `None`.
that ToggleKeyMenu is bound to `Alt-g` (`Ctrl-h` on macOS) by default and this is displayed in
the statusline. To disable the key binding, bind `Alt-g` (or `Ctrl-h` on macOS) to `None`.

default value: `false`

Expand Down