v0.1.0 602baa7

requests_test.go RawHistoryFolder

1package xproto
2
3import (
4	"bnema.dev/xturbo"
5	"testing"
6)
7
8func BenchmarkConfigureWindow(b *testing.B) {
9	buf := xturbo.NewBuf(0)
10	var v ConfigureWindowValues
11	v.SetX(-1).SetY(-2).SetWidth(800).SetHeight(600).SetBorderWidth(1).SetSibling(2).SetStackMode(StackModeAbove)
12	batch := 0
13	b.ReportAllocs()
14	b.ResetTimer()
15	for i := 0; i < b.N; i++ {
16		if batch == 60000 {
17			b.StopTimer()
18			buf = xturbo.NewBuf(0)
19			batch = 0
20			b.StartTimer()
21		}
22		buf.Reset()
23		ConfigureWindow(buf, 1, &v)
24		batch++
25	}
26	if buf.Err() != nil {
27		b.Fatal(buf.Err())
28	}
29}
30
31func BenchmarkMapWindow(b *testing.B) {
32	buf := xturbo.NewBuf(0)
33	batch := 0
34	b.ReportAllocs()
35	b.ResetTimer()
36	for i := 0; i < b.N; i++ {
37		if batch == 60000 {
38			b.StopTimer()
39			buf = xturbo.NewBuf(0)
40			batch = 0
41			b.StartTimer()
42		}
43		buf.Reset()
44		MapWindow(buf, 1)
45		batch++
46	}
47}
48
49func BenchmarkInternAtom(b *testing.B) {
50	buf := xturbo.NewBuf(0)
51	batch := 0
52	b.ReportAllocs()
53	b.ResetTimer()
54	for i := 0; i < b.N; i++ {
55		if batch == 60000 {
56			b.StopTimer()
57			buf = xturbo.NewBuf(0)
58			batch = 0
59			b.StartTimer()
60		}
61		buf.Reset()
62		InternAtom(buf, false, "WM_CLASS")
63		batch++
64	}
65}
66func BenchmarkChangeProperty4KiB(b *testing.B) {
67	buf := xturbo.NewBuf(0)
68	data := make([]byte, 4096)
69	batch := 0
70	b.ReportAllocs()
71	b.ResetTimer()
72	for i := 0; i < b.N; i++ {
73		if batch == 60000 {
74			b.StopTimer()
75			buf = xturbo.NewBuf(0)
76			batch = 0
77			b.StartTimer()
78		}
79		buf.Reset()
80		ChangeProperty(buf, 0, 1, 1, 1, 8, 4096, data)
81		batch++
82	}
83}

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 1

Tags 1

↑↓ moveenter openesc close