v0.25.1 7fabed9

keys_templ.go RawHistoryFolder

1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4// SPDX-License-Identifier: AGPL-3.0-or-later
5
6package web
7
8//lint:file-ignore SA4006 This context is only used if a nested component is present.
9
10import "github.com/a-h/templ"
11import templruntime "github.com/a-h/templ/runtime"
12
13// Keys is the keyboard map. ermite.js turns keys into k-<name> events on
14// <body>; this element is the only place that binds them, each to one call of
15// window.ermite (ermite.js), which does the work.
16func Keys() templ.Component {
17	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
18		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
19		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
20			return templ_7745c5c3_CtxErr
21		}
22		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
23		if !templ_7745c5c3_IsBuffer {
24			defer func() {
25				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
26				if templ_7745c5c3_Err == nil {
27					templ_7745c5c3_Err = templ_7745c5c3_BufErr
28				}
29			}()
30		}
31		ctx = templ.InitializeContext(ctx)
32		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
33		if templ_7745c5c3_Var1 == nil {
34			templ_7745c5c3_Var1 = templ.NopComponent
35		}
36		ctx = templ.ClearChildren(ctx)
37		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div id=\"keys\" hidden hx-on=\"k-j from:body -> ermite.move(1);\n         k-k from:body -> ermite.move(-1);\n         k-top from:body -> ermite.edge(false);\n         k-bottom from:body -> ermite.edge(true);\n         k-open from:body -> ermite.open();\n         k-right from:body -> ermite.rail(true);\n         k-left from:body -> ermite.rail(false);\n         k-esc from:body -> ermite.closeDialogs();\n         k-help from:body -> ermite.dialog('panel-help');\n         k-refs from:body -> ermite.dialog('panel-refs', 'refs-filter');\n         k-cmd from:body -> ermite.dialog('panel-cmd', 'cmd-q'); ermiteFinder.load();\n         k-filter from:body -> ermite.focusFilter();\n         k-gh from:body -> ermite.go('.brand');\n         k-s from:body -> ermite.tab('s');\n         k-t from:body -> ermite.tab('t');\n         k-c from:body -> ermite.tab('c');\n         k-r from:body -> ermite.tab('r');\n         k-m from:body -> ermite.tab('m');\n         k-next from:body -> ermite.nextNote();\n         k-split from:body -> ermite.layout('split');\n         k-unified from:body -> ermite.layout('unified');\n         k-collapse from:body -> ermite.collapse();\n         k-expand from:body -> ermite.expandFile();\n         k-expandAll from:body -> ermite.expandAll();\n         k-permalink from:body -> ermite.permalink();\n         k-merge from:body -> window.ermiteMR?.openMerge();\n         k-read from:body -> window.ermiteMR?.markRead();\n         k-gf from:body -> window.ermiteMR?.focusFiles();\n         k-keys from:body -> ermite.toggleKeys()\"></div>")
38		if templ_7745c5c3_Err != nil {
39			return templ_7745c5c3_Err
40		}
41		return nil
42	})
43}
44
45var _ = templruntime.GeneratedTemplate

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 3

Tags 44

↑↓ moveenter openesc close