v0.30.0 eb3068f

loader_actions_test.go RawHistoryFolder

1package config
2
3import (
4	"os"
5	"path/filepath"
6	"testing"
7
8	"github.com/stretchr/testify/assert"
9	"github.com/stretchr/testify/require"
10)
11
12func TestManagerLoad_UpgradesObsoleteCEFPreciseScrollDefaultInMemory(t *testing.T) {
13	home := t.TempDir()
14	t.Setenv("HOME", home)
15	t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config"))
16	t.Setenv("XDG_DATA_HOME", filepath.Join(home, ".local", "share"))
17	t.Setenv("XDG_STATE_HOME", filepath.Join(home, ".local", "state"))
18	t.Setenv("XDG_CACHE_HOME", filepath.Join(home, ".cache"))
19
20	configFile, err := GetConfigFile()
21	require.NoError(t, err)
22	require.NoError(t, os.MkdirAll(filepath.Dir(configFile), 0o755))
23	require.NoError(t, os.WriteFile(configFile, []byte(`
24[engine.cef.input]
25scroll_precise_multiplier = 0.35
26touchpad_navigation_max_vertical_ratio = 2.0
27`), 0o644))
28
29	mgr, err := NewManager()
30	require.NoError(t, err)
31	require.NoError(t, mgr.Load())
32
33	cfg := mgr.Get()
34	require.NotNil(t, cfg)
35	assert.InDelta(t, defaultCEFScrollPreciseMultiplier, cfg.Engine.CEF.Input.ScrollPreciseMultiplier, 0.001)
36	assert.InDelta(t, 2.0, cfg.Engine.CEF.Input.TouchpadNavigationMaxVerticalRatio, 0.001)
37}
38
39func TestManagerLoad_MergesMissingPaneModeActionsInMemory(t *testing.T) {
40	home := t.TempDir()
41	t.Setenv("HOME", home)
42	t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config"))
43	t.Setenv("XDG_DATA_HOME", filepath.Join(home, ".local", "share"))
44	t.Setenv("XDG_STATE_HOME", filepath.Join(home, ".local", "state"))
45	t.Setenv("XDG_CACHE_HOME", filepath.Join(home, ".cache"))
46
47	configFile, err := GetConfigFile()
48	require.NoError(t, err)
49	require.NoError(t, os.MkdirAll(filepath.Dir(configFile), 0o755))
50	require.NoError(t, os.WriteFile(configFile, []byte(`
51[workspace.pane_mode]
52activation_shortcut = "ctrl+p"
53timeout_ms = 3000
54
55[workspace.pane_mode.actions.stack-pane]
56keys = ["s"]
57desc = "Custom stack pane"
58`), 0o644))
59
60	mgr, err := NewManager()
61	require.NoError(t, err)
62	require.NoError(t, mgr.Load())
63
64	cfg := mgr.Get()
65	require.NotNil(t, cfg)
66
67	eject, ok := cfg.Workspace.PaneMode.Actions["eject-pane-to-window"]
68	require.True(t, ok)
69	assert.Equal(t, []string{"w"}, eject.Keys)
70
71	stack := cfg.Workspace.PaneMode.Actions["stack-pane"]
72	assert.Equal(t, "Custom stack pane", stack.Desc)
73}

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 8

Tags 42

↑↓ moveenter openesc close