v0.33.2 57f21d6

webview_scroll_inject.go RawHistoryFolder

1package cef
2
3// This file owns inertial-scroll injection for keyboard-driven page scrolls
4// (Vim Mode J/K, arrows). A scroll request becomes one engine impulse per
5// press or held-key step: repeats join the live wheel burst and the tail
6// coasts after release, so key scrolling feels like wheel scrolling.
7//
8// Threading contract: InjectScroll hops to the GTK thread internally and is
9// safe from any thread. Key release sends nothing on purpose: canceling
10// the burst would kill the coast, so CancelPageScroll only drains the
11// legacy JS queue (which stays empty while injection succeeds).
12
13// scrollInjectBridge is the narrow adapter seam for scroll injection.
14// *Cef2gtkAdapter satisfies it in production; tests inject a recording
15// fake. It covers only impulse acceptance, mirroring scrollCancelBridge.
16type scrollInjectBridge interface {
17	InjectScroll(dx, dy float64) bool
18}
19
20// scrollInjectTarget resolves the live adapter for scroll injection.
21func (wv *WebView) scrollInjectTarget() scrollInjectBridge {
22	if wv == nil {
23		return nil
24	}
25	if wv.scrollInjectSeam != nil {
26		return wv.scrollInjectSeam
27	}
28	if wv.viewBridge == nil {
29		return nil
30	}
31	return wv.viewBridge
32}
33
34// injectPageScroll forwards one key-scroll step to the inertial engine.
35// It reports whether the engine accepted the impulse; callers fall back to
36// the legacy queue when it does not (smoothing disabled, no bridge).
37func (wv *WebView) injectPageScroll(deltaX, deltaY int32) bool {
38	if wv == nil || !wv.inputConfig.ScrollWheelSmoothing {
39		return false
40	}
41	target := wv.scrollInjectTarget()
42	if target == nil {
43		return false
44	}
45	return target.InjectScroll(float64(deltaX), float64(deltaY))
46}

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