main 7a3b92c

keys.go RawHistoryFolder

1package popup
2
3// xkb keysyms the menu reacts to.
4const (
5	keysymBackSpace = 0xff08
6	keysymTab       = 0xff09
7	keysymEscape    = 0xff1b
8	keysymLeft      = 0xff51
9	keysymUp        = 0xff52
10	keysymDown      = 0xff54
11)
12
13// keyAction is what a key press does in a menu.
14type keyAction uint8
15
16const (
17	keyForward  keyAction = iota // pass the key to nefergui unchanged
18	keyNext                      // move the focus to the next entry (Tab)
19	keyPrevious                  // move the focus to the previous entry (Shift+Tab)
20	keyBack                      // leave the submenu
21	keyClose                     // dismiss the menu
22)
23
24// mapKey says what a key does. Up and Down walk the entries, Left and
25// BackSpace leave a submenu, Escape dismisses; everything else (Tab, Return,
26// Space…) goes to nefergui. Left and BackSpace do nothing at the top level.
27func mapKey(keysym uint32, inSubmenu bool) keyAction {
28	switch keysym {
29	case keysymDown:
30		return keyNext
31	case keysymUp:
32		return keyPrevious
33	case keysymEscape:
34		return keyClose
35	case keysymLeft, keysymBackSpace:
36		if inSubmenu {
37			return keyBack
38		}
39		return keyForward
40	}
41	return keyForward
42}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 5

Tags 4

↑↓ moveenter openesc close