Skip to content

Commit

Permalink
Add Mod-Alt-g binding for gotoLine
Browse files Browse the repository at this point in the history
FIX: Add a keybinding Mod-Alt-g for `gotoLine` to the search keymap,
to make it usable for people whose keyboard layout uses Alt/Option-g
to type some character.

Issue codemirror/dev#1301
  • Loading branch information
marijnh committed Nov 27, 2023
1 parent 8491f3d commit d0ece75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,14 +571,15 @@ export const closeSearchPanel: Command = view => {
/// - Mod-f: [`openSearchPanel`](#search.openSearchPanel)
/// - F3, Mod-g: [`findNext`](#search.findNext)
/// - Shift-F3, Shift-Mod-g: [`findPrevious`](#search.findPrevious)
/// - Alt-g: [`gotoLine`](#search.gotoLine)
/// - Mod-Alt-g, Alt-g: [`gotoLine`](#search.gotoLine)
/// - Mod-d: [`selectNextOccurrence`](#search.selectNextOccurrence)
export const searchKeymap: readonly KeyBinding[] = [
{key: "Mod-f", run: openSearchPanel, scope: "editor search-panel"},
{key: "F3", run: findNext, shift: findPrevious, scope: "editor search-panel", preventDefault: true},
{key: "Mod-g", run: findNext, shift: findPrevious, scope: "editor search-panel", preventDefault: true},
{key: "Escape", run: closeSearchPanel, scope: "editor search-panel"},
{key: "Mod-Shift-l", run: selectSelectionMatches},
{key: "Mod-Alt-g", run: gotoLine},
{key: "Alt-g", run: gotoLine},
{key: "Mod-d", run: selectNextOccurrence, preventDefault: true},
]
Expand Down

0 comments on commit d0ece75

Please sign in to comment.