v0.3.2 a514042

screen_test.go RawHistoryFolder

1package visual
2
3import (
4	"errors"
5	"fmt"
6	"testing"
7
8	"github.com/stretchr/testify/require"
9)
10
11// The messages are the ones neferclient v0.2.0 reports through Handler.Error.
12func TestLockErrorPolicyEndsOnlyOnKeyboardFailures(t *testing.T) {
13	fatal := []error{
14		errors.New("neferclient: keymap descriptor unavailable"),
15		fmt.Errorf("neferclient: unsupported keymap format %d or size %d", 2, 0),
16		fmt.Errorf("neferclient: keymap: %w", errors.New("compile failed")),
17		fmt.Errorf("neferclient: keyboard: %w", errors.New("xkb context")),
18		fmt.Errorf("neferclient: bind wl_seat: %w", errors.New("gone")),
19	}
20	benign := []error{
21		fmt.Errorf("neferclient: bind cursor shape manager: %w", errors.New("gone")),
22		fmt.Errorf("neferclient: dmabuf format table index %d out of range", 9),
23		errors.New("neferclient: invalid fractional scale zero"),
24		errors.New("timerfd read: resource temporarily unavailable"),
25	}
26	var reported []error
27	l := &locker{cfg: lockConfig{OnError: func(err error) { reported = append(reported, err) }}}
28	for _, err := range fatal {
29		require.ErrorIs(t, l.errorPolicy(err), err, "%v must end the lock run", err)
30	}
31	require.Empty(t, reported)
32	for _, err := range benign {
33		require.NoError(t, l.errorPolicy(err), "%v must not end the lock run", err)
34	}
35	require.Equal(t, benign, reported)
36}

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 2

Tags 9

↑↓ moveenter openesc close